Feature #5207 completed

Updated pom version at 6.17.0

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@148922 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2017-05-22 09:48:01 +00:00
parent 9f542d3b99
commit 8ef26bdf7a
6 changed files with 83 additions and 50 deletions

View File

@ -1,9 +1,14 @@
<ReleaseNotes> <ReleaseNotes>
<Changeset component="org.gcube.portlets-user.workspace-portlet-tree.6-17-0"
date="2017-05-22">
<Change>[Feature #5207] Integrate Image Preview Widget</Change>
</Changeset>
<Changeset component="org.gcube.portlets-user.workspace-portlet-tree.6-16-1" <Changeset component="org.gcube.portlets-user.workspace-portlet-tree.6-16-1"
date="2017-04-11"> date="2017-04-11">
<Change>Quick fix to set folder as public</Change> <Change>Quick fix to set folder as public</Change>
<Change>Updated messages to history including version of file if it is <Change>Updated messages to history including version of file if it is
present</Change> present
</Change>
</Changeset> </Changeset>
<Changeset component="org.gcube.portlets-user.workspace-portlet-tree.6-16-0" <Changeset component="org.gcube.portlets-user.workspace-portlet-tree.6-16-0"
date="2017-03-03"> date="2017-03-03">

13
pom.xml
View File

@ -10,7 +10,7 @@
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
<artifactId>workspace-tree-widget</artifactId> <artifactId>workspace-tree-widget</artifactId>
<version>6.16.1-SNAPSHOT</version> <version>6.17.0-SNAPSHOT</version>
<name>gCube Workspace Tree Widget</name> <name>gCube Workspace Tree Widget</name>
<description> <description>
gCube Workspace Tree Widget is a widget to navigate and interact with gCube Workspace gCube Workspace Tree Widget is a widget to navigate and interact with gCube Workspace
@ -132,12 +132,11 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- Auth Framework --> <dependency>
<!-- <dependency> --> <groupId>org.gcube.portlets.widgets</groupId>
<!-- <groupId>org.gcube.common</groupId> --> <artifactId>image-previewer-widget</artifactId>
<!-- <artifactId>authorization-client</artifactId> --> <version>[1.0.0-SNAPSHOT,)</version>
<!-- <scope>provided</scope> --> </dependency>
<!-- </dependency> -->
<!-- HOME LIBRARY --> <!-- HOME LIBRARY -->
<dependency> <dependency>

View File

@ -12,17 +12,23 @@
<inherits name='com.extjs.gxt.ui.GXT' /> <inherits name='com.extjs.gxt.ui.GXT' />
<inherits name='org.gcube.portal.clientcontext.GCubeClientContext' /> <inherits name='org.gcube.portal.clientcontext.GCubeClientContext' />
<inherits name="org.gcube.portlets.widgets.workspacesharingwidget.WorkspaceSharingWidget" /> <inherits
name="org.gcube.portlets.widgets.workspacesharingwidget.WorkspaceSharingWidget" />
<servlet path="/WorkspaceService" class="org.gcube.portlets.user.workspace.server.GWTWorkspaceServiceImpl" /> <servlet path="/WorkspaceService"
<inherits name="org.gcube.portlets.widgets.workspaceuploader.WorkspaceUploader"></inherits> class="org.gcube.portlets.user.workspace.server.GWTWorkspaceServiceImpl" />
<inherits name='org.gcube.portlets.widgets.ckandatapublisherwidget.CKanMetadataPublisher' /> <inherits
name="org.gcube.portlets.widgets.workspaceuploader.WorkspaceUploader"></inherits>
<inherits
name='org.gcube.portlets.widgets.ckandatapublisherwidget.CKanMetadataPublisher' />
<servlet path="/DownloadService" <servlet path="/DownloadService"
class="org.gcube.portlets.user.workspace.server.DownloadServlet" /> class="org.gcube.portlets.user.workspace.server.DownloadServlet" />
<servlet path="/ImageService" <servlet path="/ImageService"
class="org.gcube.portlets.user.workspace.server.ImageServlet" /> class="org.gcube.portlets.user.workspace.server.ImageServlet" />
<inherits name="org.gcube.portlets.widgets.imagepreviewerwidget.ImagePreviewer" />
<!-- Specify the application specific style sheet. --> <!-- Specify the application specific style sheet. -->
<stylesheet src='workspacetree.css' /> <stylesheet src='workspacetree.css' />

View File

@ -1519,7 +1519,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
@Override @Override
public void onSuccess(GWTWorkspaceItem item) { public void onSuccess(GWTWorkspaceItem item) {
GWT.log("Image loaded: "+item.toString()); GWT.log("Image loaded: "+item.getName() + " label: "+item.getLabel());
if(fileModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.IMAGE_DOCUMENT)) if(fileModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.IMAGE_DOCUMENT))
new WindowImagePreview(fileModel.getName(), (GWTImageDocument) item, positionX, positionY); new WindowImagePreview(fileModel.getName(), (GWTImageDocument) item, positionX, positionY);
else else

View File

@ -1,9 +1,14 @@
package org.gcube.portlets.user.workspace.client.view.windows; package org.gcube.portlets.user.workspace.client.view.windows;
import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.user.workspace.client.ConstantsExplorer; import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
import org.gcube.portlets.user.workspace.client.resources.Resources; import org.gcube.portlets.user.workspace.client.resources.Resources;
import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTExternalImage; import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTExternalImage;
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTImageDocument; import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTImageDocument;
import org.gcube.portlets.widgets.imagepreviewerwidget.client.EnhancedImage;
import org.gcube.portlets.widgets.imagepreviewerwidget.client.ui.Carousel;
import com.extjs.gxt.ui.client.widget.Window; import com.extjs.gxt.ui.client.widget.Window;
import com.google.gwt.core.shared.GWT; import com.google.gwt.core.shared.GWT;
@ -36,9 +41,10 @@ public class WindowImagePreview {
initWindow(name, positionX, positionY); initWindow(name, positionX, positionY);
window.add(loader); window.add(loader);
Image img = new Image(image.getThumbnailUrl()); Image img = new Image(image.getThumbnailUrl());
img.setWidth(String.valueOf(image.getThumbnailWidth())); img.setWidth(String.valueOf(image.getThumbnailWidth()));
img.setHeight(String.valueOf(image.getThumbnailHeight())); img.setHeight(String.valueOf(image.getThumbnailHeight()));
log("Thumbnail URL: "+image.getThumbnailUrl()); GWT.log("Thumbnail URL 1: "+image.getThumbnailUrl());
Image loadImg = new Image(image.getThumbnailUrl()); Image loadImg = new Image(image.getThumbnailUrl());
loadImg.addLoadHandler(new LoadHandler() { loadImg.addLoadHandler(new LoadHandler() {
@ -71,11 +77,14 @@ public class WindowImagePreview {
// System.out.println("postionX.................." + positionX); // System.out.println("postionX.................." + positionX);
// System.out.println("positionY.................." + positionY); // System.out.println("positionY.................." + positionY);
Image img = new Image(image.getThumbnailUrl()); // Image img = new Image(image.getThumbnailUrl());
img.setWidth(String.valueOf(image.getThumbnailWidth())); // GWT.log("Thumbnail URL 2: "+image.getThumbnailUrl());
img.setHeight(String.valueOf(image.getThumbnailHeight())); //// img.setWidth(String.valueOf(image.getThumbnailWidth()));
window.add(new Image(image.getThumbnailUrl())); //// img.setHeight(String.valueOf(image.getThumbnailHeight()));
window.show(); // window.add(img);
// window.show();
showCarousel(name, image.getThumbnailUrl(), positionX, positionY);
} }
@ -97,6 +106,18 @@ public class WindowImagePreview {
window.setPosition(positionX, positionY); window.setPosition(positionX, positionY);
} }
private void showCarousel(
String imageTitle, String imageURL, int positionX, int positionY) {
Carousel carousel = new Carousel();
List<EnhancedImage> list = new ArrayList<EnhancedImage>();
GWT.log("Generating imageURL: "+imageURL);
EnhancedImage myimg = new EnhancedImage(imageURL, imageTitle, imageTitle);
list.add(myimg);
carousel.updateImages(list);
carousel.hideArrows();
carousel.show();
}
/** /**
* Log. * Log.
* *

View File

@ -173,4 +173,6 @@ public abstract class GWTWorkspaceItem implements IsSerializable {
return isLoading; return isLoading;
} }
} }