From: <fg...@us...> - 2009-08-14 10:49:35
|
Revision: 1266 http://openutils.svn.sourceforge.net/openutils/?rev=1266&view=rev Author: fgiust Date: 2009-08-14 10:49:28 +0000 (Fri, 14 Aug 2009) Log Message: ----------- MEDIA-2 display metadata in media dialog Added Paths: ----------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/dialog/DialogMetadata.java Added: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/dialog/DialogMetadata.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/dialog/DialogMetadata.java (rev 0) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/dialog/DialogMetadata.java 2009-08-14 10:49:28 UTC (rev 1266) @@ -0,0 +1,45 @@ +/** + * Copyright Openmind 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.DialogStatic; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.time.FastDateFormat; + + +/** + * @author fgiust + * @version $Id$ + */ +public class DialogMetadata extends DialogStatic +{ + + @Override + protected String readValue() + { + if (StringUtils.equals(this.getName(), "creationdate") || StringUtils.equals(this.getName(), "lastmodified")) + { + return FastDateFormat.getInstance("yyyy-MM-dd, HH:mm").format( + this.getStorageNode().getMetaData().getDateProperty(this.getName())); + } + + return this.getStorageNode().getMetaData().getStringProperty(this.getName()); + } + +} Property changes on: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/dialog/DialogMetadata.java ___________________________________________________________________ Added: svn:mime-type + text/plain 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. |