Merge pull request 'task_21388' (#2) from task_21388 into master

Reviewed-on: #2
feature_23026
Francesco Mangiacrapa 3 years ago
commit b5effefc64

@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v6.33.0-SNAPSHOT] - 2021-05-11
#### Enhancements
[#21388] Integrated with new workflow to interact with ws-thredds 1.x
[#21444] Moved to maven-portal-bom >= 3.6.2-SNAPSHOT
## [v6.32.0] - 2021-04-12
#### Enhancements

@ -11,7 +11,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>workspace-tree-widget</artifactId>
<version>6.32.0</version>
<version>6.33.0-SNAPSHOT</version>
<name>gCube Workspace Tree Widget</name>
<description>
gCube Workspace Tree Widget is a widget to navigate and interact with gCube Workspace
@ -46,7 +46,7 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>3.6.1</version>
<version>3.6.2-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@ -65,7 +65,6 @@
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>storagehub-icons-library</artifactId>
<version>[1.0.0, 2.0.0-SNAPSHOT)</version>
<scope>compile</scope>
</dependency>
<dependency>

@ -3,7 +3,6 @@ package org.gcube.portlets.user.workspace.client.model;
import java.io.Serializable;
import java.util.List;
import org.gcube.portal.wssynclibrary.shared.thredds.Sync_Status;
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
import org.gcube.portlets.user.workspace.client.interfaces.GXTCategorySmartFolder;
import org.gcube.portlets.user.workspace.client.interfaces.GXTFolderItemTypeEnum;
@ -16,13 +15,12 @@ import com.google.gwt.user.client.rpc.IsSerializable;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.Image;
// TODO: Auto-generated Javadoc
/**
* The Class FileModel.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa{@literal @}isti.cnr.it
* Sep 15, 2016
* Sep 15, 2016
*/
public class FileModel extends BaseModelData implements Serializable, IsSerializable {
@ -31,8 +29,8 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*/
private static final long serialVersionUID = 1L;
protected GXTFolderItemTypeEnum folderItemType; //It's here to serialization don't remove
protected GXTCategorySmartFolder smartFolders; //It's here to serialization don't remove
protected GXTFolderItemTypeEnum folderItemType; // It's here to serialization don't remove
protected GXTCategorySmartFolder smartFolders; // It's here to serialization don't remove
protected InfoContactModel infoContacts;
protected boolean isRoot = false;
protected boolean isVreFolder;
@ -55,23 +53,23 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
public static final String OWNERFULLNAME = "Owner Name";
public static final String HUMAN_REDABLE_CATEGORY = "HR Category";
//Thredds Synch status
private Sync_Status synchedThreddsStatus;
// Synched with thredds
private Boolean synchedWithWsThredds = null;
/**
* Instantiates a new file model.
*/
protected FileModel(){
protected FileModel() {
}
/**
* Instantiates a new file model.
*
* @param identifier the identifier
* @param name the name
* @param parent the parent
* @param identifier the identifier
* @param name the name
* @param parent the parent
* @param isDirectory the is directory
* @param isShared the is shared
* @param isShared the is shared
*/
public FileModel(String identifier, String name, FileModel parent, boolean isDirectory, boolean isShared) {
setIdentifier(identifier);
@ -85,8 +83,8 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
/**
* USED FOR ATTACHMENTS AND FolderBulkCreator.
*
* @param identifier the identifier
* @param name the name
* @param identifier the identifier
* @param name the name
* @param isDirectory the is directory
*/
public FileModel(String identifier, String name, boolean isDirectory) {
@ -99,7 +97,7 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
/**
* Inits the default properties.
*/
protected void initDefaultProperties(){
protected void initDefaultProperties() {
setShortcutCategory(GXTCategorySmartFolder.SMF_UNKNOWN);
setShareable(true);
}
@ -110,7 +108,7 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
* @param bool the new shareable
*/
public void setShareable(boolean bool) {
set(ConstantsExplorer.ISSHAREABLE,bool);
set(ConstantsExplorer.ISSHAREABLE, bool);
}
@ -119,7 +117,7 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*
* @param description the new description
*/
public void setDescription(String description){
public void setDescription(String description) {
set(ConstantsExplorer.DIRECTORYDESCRIPTION, description);
}
@ -128,7 +126,7 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*
* @return the description
*/
public String getDescription(){
public String getDescription() {
return get(ConstantsExplorer.DIRECTORYDESCRIPTION);
}
@ -139,7 +137,7 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*/
public boolean isShareable() {
Object sharable = get(ConstantsExplorer.ISSHAREABLE);
if(sharable!=null)
if (sharable != null)
return (Boolean) sharable;
return false;
}
@ -147,14 +145,15 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
/**
* Instantiates a new file model.
*
* @param identifier the identifier
* @param name the name
* @param type the type
* @param identifier the identifier
* @param name the name
* @param type the type
* @param folderItemTypeEnum the folder item type enum
* @param isDirectory the is directory
* @param isShared the is shared
* @param isDirectory the is directory
* @param isShared the is shared
*/
public FileModel(String identifier, String name, String type, GXTFolderItemTypeEnum folderItemTypeEnum, boolean isDirectory, boolean isShared) {
public FileModel(String identifier, String name, String type, GXTFolderItemTypeEnum folderItemTypeEnum,
boolean isDirectory, boolean isShared) {
setIdentifier(identifier);
setName(name);
setType(type);
@ -170,14 +169,12 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
* @param parent the new parent file model
*/
public void setParentFileModel(FileModel parent) {
set(PARENT,parent);
set(PARENT, parent);
}
/**
* Status values
* ConstantsExplorer.FOLDERNOTLOAD = "notload";
* ConstantsExplorer.FOLDERLOADED = "loaded";
* Status values ConstantsExplorer.FOLDERNOTLOAD = "notload";
* ConstantsExplorer.FOLDERLOADED = "loaded";
*
* @param status the new status
*/
@ -192,9 +189,9 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
Image icon = (Image) get(ICON);
AbstractImagePrototype iconAbs;
if(icon==null){
if (icon == null) {
iconAbs = getAbstractPrototypeIcon();
}else
} else
return;
set(ICON, iconAbs.createImage());
@ -206,7 +203,7 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*
* @param fullName the new owner full name
*/
public void setOwnerFullName(String fullName){
public void setOwnerFullName(String fullName) {
set(FileModel.OWNERFULLNAME, fullName);
}
@ -215,17 +212,17 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*
* @return the owner full name
*/
public String getOwnerFullName(){
public String getOwnerFullName() {
return get(FileModel.OWNERFULLNAME);
}
/**
* Sets the sharing value.
*
* @param isShared the is shared
* @param isShared the is shared
* @param listShareUsers the list share users
*/
public void setSharingValue(boolean isShared, List<InfoContactModel> listShareUsers){
public void setSharingValue(boolean isShared, List<InfoContactModel> listShareUsers) {
set(ISSHARED, isShared);
set(SHAREUSERS, listShareUsers);
}
@ -236,7 +233,7 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
* @return the list user sharing
*/
@SuppressWarnings("unchecked")
public List<InfoContactModel> getListUserSharing(){
public List<InfoContactModel> getListUserSharing() {
return (List<InfoContactModel>) get(SHAREUSERS);
}
@ -245,7 +242,7 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*
* @param listShareUsers the new list share user
*/
public void setListShareUser(List<InfoContactModel> listShareUsers){
public void setListShareUser(List<InfoContactModel> listShareUsers) {
set(SHAREUSERS, listShareUsers);
}
@ -254,9 +251,9 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*
* @return true, if is shared
*/
public boolean isShared(){
public boolean isShared() {
Object shared = get(ISSHARED);
if(shared!=null)
if (shared != null)
return (Boolean) shared;
return false;
}
@ -266,7 +263,7 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*
* @return true, if is root
*/
public boolean isRoot(){
public boolean isRoot() {
return isRoot;
}
@ -275,11 +272,10 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*
* @param isRoot the new checks if is root
*/
public void setIsRoot(boolean isRoot){
public void setIsRoot(boolean isRoot) {
this.isRoot = isRoot;
}
/**
* Gets the icon.
*
@ -296,61 +292,56 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*/
public AbstractImagePrototype getAbstractPrototypeIcon() {
GWT.log("My prop: "+this.toString());
GWT.log("My prop: " + this.toString());
AbstractImagePrototype absImgPr = Resources.getIconTable();
if (!this.isDirectory()) { //IS FILE
if(this.getType()!=null)
if (!this.isDirectory()) { // IS FILE
if (this.getType() != null)
absImgPr = Resources.getIconByType(this.getName(), this.getType());
else
absImgPr = Resources.getIconByFolderItemType(this.getGXTFolderItemType());
}else if(this.isShared()){ //IS A SHARED FOLDER?
} else if (this.isShared()) { // IS A SHARED FOLDER?
//GWT.log("setting icon "+this.getName()+" is shared: "+this.isShared() + ", this.isVreFolder() "+this.isVreFolder() +", this.isShareable() "+this.isShareable());
// GWT.log("setting icon "+this.getName()+" is shared: "+this.isShared() + ",
// this.isVreFolder() "+this.isVreFolder() +", this.isShareable()
// "+this.isShareable());
if(this.isVreFolder())
absImgPr = Resources.getIconVREFolder();
else{
if(this.isShareable()){ //IS ROOT SHARED FOLDER
if(this.isPublic()) //IS PLUBIC
absImgPr = Resources.getIconFolderSharedPublic();
if (this.isVreFolder())
absImgPr = Resources.getIconVREFolder();
else {
if (this.isShareable()) { // IS ROOT SHARED FOLDER
if (this.isPublic()) // IS PLUBIC
absImgPr = Resources.getIconFolderSharedPublic();
else
absImgPr = Resources.getIconSharedFolder();
}else{ //IS A DESCENDANT
if(this.isPublic()) //IS PLUBIC
absImgPr = Resources.getIconSharedFolder();
} else { // IS A DESCENDANT
if (this.isPublic()) // IS PLUBIC
absImgPr = Resources.getIconFolderPublic();
else
absImgPr = Resources.getIconSharedFolder(); //IS A SHARED FOLDER DESCENDANT OF ROOT SHARED FOLDER
absImgPr = Resources.getIconSharedFolder(); // IS A SHARED FOLDER DESCENDANT OF ROOT SHARED
// FOLDER
}
}
}else if(this.getStatus() == ConstantsExplorer.FOLDERNOTLOAD){ //IS A FOLDER IN LOADING
} else if (this.getStatus() == ConstantsExplorer.FOLDERNOTLOAD) { // IS A FOLDER IN LOADING
absImgPr = Resources.getIconLoading2();
}else{
//SPECIAL FOLDER?
if(this.isSpecialFolder())
} else {
// SPECIAL FOLDER?
if (this.isSpecialFolder())
absImgPr = Resources.getIconSpecialFolder();
else{ //SIMPLE FOLDER
if(this.isPublic()) //IS PLUBIC
absImgPr = Resources.getIconFolderPublic();
else { // SIMPLE FOLDER
if (this.isPublic()) // IS PLUBIC
absImgPr = Resources.getIconFolderPublic();
else {
if(this.getSynchedThreddsStatus()!=null) {
switch(this.getSynchedThreddsStatus()) {
case OUTDATED_REMOTE:
absImgPr = Resources.getIconSyncTo();
break;
case OUTDATED_WS:
absImgPr = Resources.getIconSyncFrom();
break;
case UP_TO_DATE:
absImgPr = Resources.getIconSynched();
break;
if (this.getSynchedWithWsThredds() != null) {
if(this.getSynchedWithWsThredds()) {
absImgPr = Resources.getIconSynchedFolder();
}
}else
absImgPr = Resources.getIconFolder();
} else
absImgPr = Resources.getIconFolder();
}
}
}
@ -358,7 +349,6 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
return absImgPr;
}
/**
* Gets the status.
*
@ -368,13 +358,12 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
return get("status");
}
/**
* Sets the checks if is directory.
*
* @param flag the new checks if is directory
*/
public void setIsDirectory(boolean flag){
public void setIsDirectory(boolean flag) {
set(ISDIRECTORY, flag);
}
@ -392,7 +381,7 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*
* @return the identifier
*/
public String getIdentifier(){
public String getIdentifier() {
return get(IDENTIFIER);
}
@ -403,21 +392,19 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*/
public void setShortcutCategory(GXTCategorySmartFolder smfDocuments) {
set(SHORTCUTCATEGORY, smfDocuments);
if(smfDocuments!=null)
if (smfDocuments != null)
set(HUMAN_REDABLE_CATEGORY, smfDocuments.getValue());
}
/**
* Gets the shortcut category.
*
* @return the shortcut category
*/
public GXTCategorySmartFolder getShortcutCategory(){
public GXTCategorySmartFolder getShortcutCategory() {
return (GXTCategorySmartFolder) get(SHORTCUTCATEGORY);
}
/**
* Sets the name.
*
@ -441,7 +428,7 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*
* @return the parent file model
*/
public FileModel getParentFileModel(){
public FileModel getParentFileModel() {
return (FileModel) get(PARENT);
}
@ -450,14 +437,16 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*
* @return true, if is directory
*/
public boolean isDirectory(){
public boolean isDirectory() {
Object directory = get(ISDIRECTORY);
if(directory!=null)
if (directory != null)
return (Boolean) directory;
return false;
}
/* (non-Javadoc)
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
/**
@ -489,7 +478,7 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*
* @param type the new type
*/
public void setType(String type){
public void setType(String type) {
set(TYPE, type);
}
@ -498,7 +487,7 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*
* @return the type
*/
public String getType(){
public String getType() {
return get(TYPE);
}
@ -507,7 +496,7 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*
* @param folderItemTypeEnum the new folder item type
*/
public void setFolderItemType(GXTFolderItemTypeEnum folderItemTypeEnum){
public void setFolderItemType(GXTFolderItemTypeEnum folderItemTypeEnum) {
set(FOLDERITEMTYPE, folderItemTypeEnum);
}
@ -516,7 +505,7 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*
* @return the GXT folder item type
*/
public GXTFolderItemTypeEnum getGXTFolderItemType(){
public GXTFolderItemTypeEnum getGXTFolderItemType() {
return (GXTFolderItemTypeEnum) get(FOLDERITEMTYPE);
}
@ -571,21 +560,31 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
*
* @return true, if is public
*/
public boolean isPublic(){
public boolean isPublic() {
return isPublic;
}
public void setSyncThreddsStatus(Sync_Status status) {
this.synchedThreddsStatus = status;
/**
* Sets the synched with ws thredds.
*
* @param bool the new synched with ws thredds
*/
public void setSynchedWithWsThredds(Boolean bool) {
this.synchedWithWsThredds = bool;
}
public Sync_Status getSynchedThreddsStatus() {
return synchedThreddsStatus;
/**
* Gets the synched with ws thredds.
*
* @return the synched with ws thredds
*/
public Boolean getSynchedWithWsThredds() {
return synchedWithWsThredds;
}
/* (non-Javadoc)
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
/**
@ -620,5 +619,4 @@ public class FileModel extends BaseModelData implements Serializable, IsSerializ
return builder.toString();
}
}

@ -411,12 +411,15 @@ public interface Icons extends ClientBundle {
@Source("icons/sync-icon-to.png")
ImageResource syncIconTo();
@Source("icons/sync-icon-from.png")
ImageResource syncIconFrom();
@Source("icons/sync-icon-synched.png")
ImageResource syncIconSynched();
@Source("icons/folder_sync.png")
ImageResource synchedFolder();
// @Source("icons/sync-icon-from.png")
// ImageResource syncIconFrom();
//
// @Source("icons/sync-icon-synched.png")
// ImageResource syncIconSynched();
@Source("icons/no-preview-available.png")
ImageResource previewNotAvailable();

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

@ -114,11 +114,11 @@ public class DialogGetInfo extends Dialog {
txtIsPublic.setValue(fileModel.isPublic() + "");
add(txtIsPublic);
if (fileModel.getSynchedThreddsStatus() != null) {
if (fileModel.getSynchedWithWsThredds() != null) {
txtThreddsSynched = new TextField<String>();
txtThreddsSynched.setFieldLabel("Thredds Sync");
txtThreddsSynched.setFieldLabel("Synched with Thredds");
txtThreddsSynched.setReadOnly(true);
txtThreddsSynched.setValue(fileModel.getSynchedThreddsStatus() + "");
txtThreddsSynched.setValue(fileModel.getSynchedWithWsThredds() + "");
add(txtThreddsSynched);
}

@ -294,11 +294,16 @@ public class DialogGetInfoBootstrap extends Composite {
if (fileModel.isDirectory()) {
cgTxtIsPublic.setVisible(true);
htmlSetValue(txtIsPublic, fileModel.isPublic() + "");
if (fileModel.getSynchedThreddsStatus() != null) {
txtThreddsSynched.setVisible(true);
htmlSetValue(txtThreddsSynched, fileModel.getSynchedThreddsStatus() + "");
txtThreddsSynched.setHTML(fileModel.getSynchedThreddsStatus() + "");
GWT.log("Is synched? "+fileModel.getSynchedWithWsThredds());
if (fileModel.getSynchedWithWsThredds() != null) {
if (fileModel.getSynchedWithWsThredds()) {
cgThreddsSynched.setVisible(true);
//txtThreddsSynched.setVisible(true);
htmlSetValue(txtThreddsSynched, fileModel.getSynchedWithWsThredds() + "");
txtThreddsSynched.setHTML(fileModel.getSynchedWithWsThredds() + "");
}
}
}

@ -73,7 +73,7 @@
<b:ControlGroup
addStyleNames="my-control-group-get-info"
ui:field="cgThreddsSynched" visible="false">
<b:ControlLabel>Thredds Sync</b:ControlLabel>
<b:ControlLabel title="Synched with THREDDS">Synched</b:ControlLabel>
<b:Controls>
<g:HTML ui:field="txtThreddsSynched">
</g:HTML>

@ -63,9 +63,6 @@ public class ObjectStorageHubToWorkpaceMapper {
isVreFolder = sharedFolder.isVreFolder();
}
// FolderModel root = new FolderModel(workspaceRoot.getId(),workspaceRoot.getName(),null, true, workspaceRoot.isShared(), false, workspaceRoot.isPublic());
// root.setIsRoot(true);
FolderModel theFolder = new FolderModel(folder.getId(), folder.getName(), null, folder.isFolder(), folder.isShared(), isVreFolder, isPublicFolder);
theFolder.setIsRoot(folder.isRoot());
return theFolder;

Loading…
Cancel
Save