From echatellier@users.forge.codelutin.com Mon Feb 25 16:02:05 2013
From: echatellier@users.forge.codelutin.com
To: cantharella-commits@list.forge.codelutin.com
Subject: [Cantharella-commits] r155 - in
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web:
pages/domain/document/panel utils/columns
Date: Mon, 25 Feb 2013 16:02:05 +0100
Message-ID: <20130225150205.111C915A3E@nuiton.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8924988059605362951=="
--===============8924988059605362951==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Author: echatellier
Date: 2013-02-25 16:02:04 +0100 (Mon, 25 Feb 2013)
New Revision: 155
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/155
Log:
Display documents with custom table/listview
Added:
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/do=
cument/panel/DocumentLinkPanel.html
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/do=
cument/panel/DocumentLinkPanel.java
Removed:
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/do=
cument/panel/DocumentLinkColumn$RenderPanel.html
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/do=
cument/panel/DocumentLinkColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/A=
jaxButtonPropertyColumn$ButtonPanel.html
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/A=
jaxButtonPropertyColumn.java
Modified:
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/do=
cument/panel/ManageListDocumentsPanel.html
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/do=
cument/panel/ManageListDocumentsPanel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/do=
cument/panel/ReadListDocumentsPanel.html
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/do=
cument/panel/ReadListDocumentsPanel.java
Deleted: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/dom=
ain/document/panel/DocumentLinkColumn$RenderPanel.html
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/d=
ocument/panel/DocumentLinkColumn$RenderPanel.html 2013-02-25 11:41:29 UTC (re=
v 154)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/d=
ocument/panel/DocumentLinkColumn$RenderPanel.html 2013-02-25 15:02:04 UTC (re=
v 155)
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
Deleted: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/dom=
ain/document/panel/DocumentLinkColumn.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/d=
ocument/panel/DocumentLinkColumn.java 2013-02-25 11:41:29 UTC (rev 154)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/d=
ocument/panel/DocumentLinkColumn.java 2013-02-25 15:02:04 UTC (rev 155)
@@ -1,95 +0,0 @@
-/*
- * #%L
- * Cantharella :: Web
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2009 - 2013 IRD (Institut de Recherche pour le Developpemen=
t) and by respective authors (see below)
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published =
by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *=20
- * 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.
- *=20
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- * #L%
- */
-package nc.ird.cantharella.web.pages.domain.document.panel;
-
-import nc.ird.cantharella.data.model.Document;
-
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopu=
lator;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.Abstract=
Column;
-import org.apache.wicket.markup.html.WebComponent;
-import org.apache.wicket.markup.html.image.Image;
-import org.apache.wicket.markup.html.link.ResourceLink;
-import org.apache.wicket.markup.html.panel.Panel;
-import org.apache.wicket.markup.repeater.Item;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.request.resource.ByteArrayResource;
-import org.apache.wicket.request.resource.ContextRelativeResource;
-
-/**
- * Document download link including thumbnail display for images.
- *=20
- * @author Eric Chatellier
- *
- * @param the type of the sort property
- */
-public class DocumentLinkColumn extends AbstractColumn {
-
- /**
- * Constructor.
- * @param displayModel header display model
- */
- public DocumentLinkColumn(IModel displayModel) {
- super(displayModel);
- }
-
- /** {@inheritDoc} */
- @Override
- public void populateItem(Item> item, String com=
ponentId, IModel model) {
-
- RenderPanel panel =3D new RenderPanel(componentId, model);
- item.add(panel);
- }
-
- /**
- * Panel which include a linkable image. Used with the LinkableImageProp=
ertyColumn$LinkablePanel.html file
- */
- public class RenderPanel extends Panel {
-
- /**
- * Constructor
- * @param id Component id
- * @param model model
- */
- public RenderPanel(String id, final IModel model) {
- super(id);
-
- final Document document =3D model.getObject();
- ResourceLink link =3D new ResourceLink("link=
", new ByteArrayResource(document
- .getFileMimetype(), document.getFileContent()));
- add(link);
-
- WebComponent img;
- if (ArrayUtils.isNotEmpty(document.getFileContentThumb())) {
- link.add(new AttributeModifier("class", "colorbox"));
- link.add(new AttributeModifier("title", document.getFileName=
()));
- img =3D new Image("image", new ByteArrayResource("image/png"=
, document.getFileContentThumb()));
- } else {
- img =3D new Image("image", new ContextRelativeResource("imag=
es/download.png"));
- }
- img.add(new AttributeModifier("title", document.getFileName()));
- link.add(img);
- }
- }
-}
Added: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domai=
n/document/panel/DocumentLinkPanel.html
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/d=
ocument/panel/DocumentLinkPanel.html (rev 0)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/d=
ocument/panel/DocumentLinkPanel.html 2013-02-25 15:02:04 UTC (rev 155)
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Added: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domai=
n/document/panel/DocumentLinkPanel.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/d=
ocument/panel/DocumentLinkPanel.java (rev 0)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/d=
ocument/panel/DocumentLinkPanel.java 2013-02-25 15:02:04 UTC (rev 155)
@@ -0,0 +1,44 @@
+package nc.ird.cantharella.web.pages.domain.document.panel;
+
+import nc.ird.cantharella.data.model.Document;
+
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.markup.html.WebComponent;
+import org.apache.wicket.markup.html.image.Image;
+import org.apache.wicket.markup.html.link.ResourceLink;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.request.resource.ByteArrayResource;
+import org.apache.wicket.request.resource.ContextRelativeResource;
+
+/**
+ * Panel which include a linkable image. Used with the LinkableImageProperty=
Column$LinkablePanel.html file
+ */
+public class DocumentLinkPanel extends Panel {
+
+ /**
+ * Constructor
+ * @param id Component id
+ * @param model model
+ */
+ public DocumentLinkPanel(String id, final IModel model) {
+ super(id);
+
+ final Document document =3D model.getObject();
+ ResourceLink link =3D new ResourceLink("link", n=
ew ByteArrayResource(document
+ .getFileMimetype(), document.getFileContent()));
+ add(link);
+
+ WebComponent img;
+ if (ArrayUtils.isNotEmpty(document.getFileContentThumb())) {
+ link.add(new AttributeModifier("class", "colorbox"));
+ link.add(new AttributeModifier("title", document.getFileName()));
+ img =3D new Image("image", new ByteArrayResource("image/png", do=
cument.getFileContentThumb()));
+ } else {
+ img =3D new Image("image", new ContextRelativeResource("images/d=
ownload.png"));
+ }
+ img.add(new AttributeModifier("title", document.getFileName()));
+ link.add(img);
+ }
+}
Property changes on: trunk/cantharella.web/src/main/java/nc/ird/cantharella/w=
eb/pages/domain/document/panel/DocumentLinkPanel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/do=
main/document/panel/ManageListDocumentsPanel.html
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/d=
ocument/panel/ManageListDocumentsPanel.html 2013-02-25 11:41:29 UTC (rev 154)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/d=
ocument/panel/ManageListDocumentsPanel.html 2013-02-25 15:02:04 UTC (rev 155)
@@ -27,14 +27,54 @@
=20
-