From: <fg...@us...> - 2010-02-06 20:52:05
|
Revision: 1826 http://openutils.svn.sourceforge.net/openutils/?rev=1826&view=rev Author: fgiust Date: 2010-02-06 20:51:58 +0000 (Sat, 06 Feb 2010) Log Message: ----------- MEDIA-76 Add a "document type handler" for pds in default configuration Added Paths: ----------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/dialog/DialogFileDocument.java trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/DocumentTypeHandler.java trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media/config.modules.media.dialogs.mediaDocumentDlg.xml trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media/config.modules.media.mediatypes.document.xml Added: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/dialog/DialogFileDocument.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/dialog/DialogFileDocument.java (rev 0) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/dialog/DialogFileDocument.java 2010-02-06 20:51:58 UTC (rev 1826) @@ -0,0 +1,41 @@ +/** + * + * Magnolia SimpleMedia Module (http://www.openmindlab.com/lab/products/media.html) + * Copyright (C)2008 - 2010, 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.dialog; + +import info.magnolia.cms.gui.dialog.DialogFile; + + +/** + * @author dschivo + * @version $Id$ + */ +public class DialogFileDocument extends DialogFile +{ + + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + @Override + public void initImageExtensions() + { + this.getImageExtensions().add("pdf"); + } + +} Property changes on: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/dialog/DialogFileDocument.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/DocumentTypeHandler.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/DocumentTypeHandler.java (rev 0) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/DocumentTypeHandler.java 2010-02-06 20:51:58 UTC (rev 1826) @@ -0,0 +1,50 @@ +/** + * + * Magnolia SimpleMedia Module (http://www.openmindlab.com/lab/products/media.html) + * Copyright (C)2008 - 2010, 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.types.impl; + +import info.magnolia.cms.core.Content; + +import java.util.Collections; + + +/** + * @author dschivo + * @version $Id$ + */ +public class DocumentTypeHandler extends BaseTypeHandler +{ + + /** + * {@inheritDoc} + */ + public String getThumbnailUrl(Content media) + { + return "/.resources/file-icons/pdf.png"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getUrl(Content media) + { + return getUrl(media, Collections.<String, String> emptyMap()); + } + +} Property changes on: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/DocumentTypeHandler.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media/config.modules.media.dialogs.mediaDocumentDlg.xml =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media/config.modules.media.dialogs.mediaDocumentDlg.xml (rev 0) +++ trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media/config.modules.media.dialogs.mediaDocumentDlg.xml 2010-02-06 20:51:58 UTC (rev 1826) @@ -0,0 +1,219 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="mediaDocumentDlg" 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:uuid" sv:type="String"> + <sv:value>1bfdfac9-e8ad-4f23-ae19-bb541e095322</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlmedia.media.dialog.LayerDialogMVC</sv:value> + </sv:property> + <sv:property sv:name="height" sv:type="String"> + <sv:value>500</sv:value> + </sv:property> + <sv:property sv:name="i18nBasename" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlmedia.media.lang.messages</sv:value> + </sv:property> + <sv:property sv:name="label" sv:type="String"> + <sv:value>media.dialogs.mediaImageDlg.label</sv:value> + </sv:property> + <sv:property sv:name="width" sv:type="String"> + <sv:value>520</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="mgnl:Data" sv:type="String"> + <sv:value>MetaData</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:activatorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>fgiustcms</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="String"> + <sv:value>2004-11-02T15:34:23.417+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastaction" sv:type="Date"> + <sv:value>2008-06-08T14:48:46.351+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-01-25T11:22:54.547+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="tabImage"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>e44e8d79-9709-49fc-83ac-f61af6b3b664</sv:value> + </sv:property> + <sv:property sv:name="controlType" sv:type="String"> + <sv:value>tab</sv:value> + </sv:property> + <sv:property sv:name="label" sv:type="String"> + <sv:value>Documento</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="mgnl:Data" sv:type="String"> + <sv:value>MetaData</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:activatorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>fgiustcms</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="String"> + <sv:value>2004-11-02T15:34:29.217+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastaction" sv:type="Date"> + <sv:value>2008-06-21T09:54:59.540Z</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-01-25T11:23:06.057+01:00</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="original"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>0691b96d-06b3-4424-bb12-f8bedabd42f2</sv:value> + </sv:property> + <sv:property sv:name="controlType" sv:type="String"> + <sv:value>mediaFile</sv:value> + </sv:property> + <sv:property sv:name="extensions" sv:type="String"> + <sv:value>pdf</sv:value> + </sv:property> + <sv:property sv:name="label" sv:type="String"> + <sv:value>Documento</sv:value> + </sv:property> + <sv:property sv:name="required" sv:type="String"> + <sv:value>true</sv:value> + </sv:property> + <sv:property sv:name="type" sv:type="String"> + <sv:value>Binary</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="mgnl:Data" sv:type="String"> + <sv:value>MetaData</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:activatorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>fgiustcms</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="String"> + <sv:value>2004-11-02T15:34:29.357+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastaction" sv:type="Date"> + <sv:value>2008-06-21T10:24:21.253Z</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-01-25T11:24:24.945+01:00</sv:value> + </sv:property> + </sv:node> + </sv:node> + </sv:node> + <sv:node sv:name="tabAttributes"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>83d4fdbe-55de-4c14-b5e9-abdb22719a63</sv:value> + </sv:property> + <sv:property sv:name="reference" sv:type="String"> + <sv:value>/modules/media/dialogs/common/tabAttributes</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="mgnl:Data" sv:type="String"> + <sv:value>MetaData</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:activatorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>fgiustcms</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="String"> + <sv:value>2004-11-02T15:34:29.217+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastaction" sv:type="Date"> + <sv:value>2008-07-02T16:35:26.540Z</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-01-25T11:22:46.947+01:00</sv:value> + </sv:property> + </sv:node> + </sv:node> + <sv:node sv:name="type"> + <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:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>767f77f1-83fd-41ec-acd7-d550c969406d</sv:value> + </sv:property> + <sv:property sv:name="controlType" sv:type="String"> + <sv:value>hidden</sv:value> + </sv:property> + <sv:property sv:name="defaultValue" sv:type="String"> + <sv:value>document</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="mgnl:activated" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activatorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>fgiustcms</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2008-06-21T10:51:52.322Z</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastaction" sv:type="Date"> + <sv:value>2008-06-21T10:51:56.016Z</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-01-25T12:05:00.528+01:00</sv:value> + </sv:property> + </sv:node> + </sv:node> +</sv:node> Property changes on: trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media/config.modules.media.dialogs.mediaDocumentDlg.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media/config.modules.media.mediatypes.document.xml =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media/config.modules.media.mediatypes.document.xml (rev 0) +++ trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media/config.modules.media.mediatypes.document.xml 2010-02-06 20:51:58 UTC (rev 1826) @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="document" 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:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>d9ab60e2-0903-4f9c-be46-c0b907c361fe</sv:value> + </sv:property> + <sv:property sv:name="dialog" sv:type="String"> + <sv:value>mediaDocumentDlg</sv:value> + </sv:property> + <sv:property sv:name="enabled" sv:type="Boolean"> + <sv:value>true</sv:value> + </sv:property> + <sv:property sv:name="extensions" sv:type="String"> + <sv:value>doc,pdf,docx,odt,xls,ppt</sv:value> + </sv:property> + <sv:property sv:name="handler" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlmedia.media.types.impl.DocumentTypeHandler</sv:value> + </sv:property> + <sv:property sv:name="label" sv:type="String"> + <sv:value>document</sv:value> + </sv:property> + <sv:property sv:name="menuIcon" sv:type="String"> + <sv:value>/.resources/file-icons/pdf.png</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="mgnl:activated" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activatorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2008-06-17T16:49:16.314Z</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastaction" sv:type="Date"> + <sv:value>2008-06-21T08:55:30.375Z</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-01-09T12:48:31.017+01:00</sv:value> + </sv:property> + </sv:node> +</sv:node> Property changes on: trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media/config.modules.media.mediatypes.document.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |