Updated in order to use setPublic(boolean bool)

Updated icons

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@131399 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2016-09-15 14:42:41 +00:00
parent 53ea8e8d5f
commit ccdf36480c
8 changed files with 389 additions and 339 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/workspace-6.13.1-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/workspace-6.14.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -26,5 +26,5 @@
</attributes>
</classpathentry>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry kind="output" path="target/workspace-6.13.1-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/workspace-6.14.0-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -557,7 +557,7 @@ public class AppController implements SubscriberInterface {
}
GWT.log("FILE MODEL DOUBLE CLICK: "+fileModel);
FolderModel folder = new FolderModel(fileModel.getIdentifier(), fileModel.getName(), fileModel.getParentFileModel(), true, fileModel.isShared(),fileModel.isVreFolder());
FolderModel folder = new FolderModel(fileModel.getIdentifier(), fileModel.getName(), fileModel.getParentFileModel(), true, fileModel.isShared(),fileModel.isVreFolder(), fileModel.isPublic());
updateStoreByRpc(folder);
wsPortlet.getGridGroupContainer().setCurrentFolderView(folder);
loadBreadcrumbByFileModel(fileModel, true);
@ -867,7 +867,7 @@ public class AppController implements SubscriberInterface {
List<FileModel> ingnoreFile = new ArrayList<FileModel>(size);
for (FileModel file : targets) {
GWT.log("Checking file "+file);
if(file.getType()!=null && file.getType().equals(GXTFolderItemTypeEnum.SHARED_FOLDER.toString()) || file.isSpecialFolder()){
if(file.getType()!=null && file.getType().equals(GXTFolderItemTypeEnum.FOLDER_SHARED.toString()) || file.isSpecialFolder()){
ingnoreFile.add(file);
clearTargets.remove(file);
}
@ -1498,7 +1498,7 @@ public class AppController implements SubscriberInterface {
return;
//CREATE FOLDER PARENT FOR RPC
final FileModel parent = new FolderModel(folder.getIdentifier(), folder.getName(), folder.getParentFileModel(), true, folder.isShared(), folder.isVreFolder());
final FileModel parent = new FolderModel(folder.getIdentifier(), folder.getName(), folder.getParentFileModel(), true, folder.isShared(), folder.isVreFolder(), folder.isPublic());
wsPortlet.getGridGroupContainer().mask(ConstantsExplorer.LOADING,ConstantsExplorer.LOADINGSTYLE);
appContrExplorer.getRpcWorkspaceService().getFolderChildrenForFileGrid(parent, new AsyncCallback<List<FileGridModel>>() {

View File

@ -1,7 +1,6 @@
package org.gcube.portlets.user.workspace.client.view;
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
import org.gcube.portlets.user.workspace.client.ConstantsPortlet;
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
import org.gcube.portlets.user.workspace.client.model.FileModel;
@ -35,7 +34,7 @@ public class GxtListView extends LayoutContainer {
ListView<FileGridModel> view = new ListView<FileGridModel>() {
@Override
protected FileGridModel prepareData(FileGridModel model) {
String s = model.get(ConstantsExplorer.NAME);
String s = model.get(FileModel.NAME);
model.set("shortName", Format.ellipse(s, 15));
return model;
}

View File

@ -173,7 +173,7 @@ public class WorkspaceFeaturesView extends Composite {
overFolderlk.setAnimation(false);
overFolderlk.setWidget(flk);
overFolderlk.setHeading("Workspace Folder Link");
String icon = "<span style=\"margin-right:5px\">"+Resources.getIconFolderLink().getSafeHtml().asString()+"</span>";
String icon = "<span style=\"margin-right:5px\">"+Resources.getIconFolderPublic().getSafeHtml().asString()+"</span>";
overFolderlk.setText(icon+"The owner or administrator can create the Folder Link as public link in order to allow 'guest' users to access to the content of the folder (and its sub-folders). " +
"The 'guest' user will access in read-only mode and it will can navigate and download files of the Folder Link (and its subfolders). You can send the Folder Link to anyone by pasting it into Workspace Message, your emails, instant messages, etc.");
overFolderlk.setHtml(true);

View File

@ -82,15 +82,15 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
public GxtGridFilterGroupPanel(boolean group) {
// setLayout(new FitLayout());
setId("GxtGridFilterGroupPanel "+Random.nextInt());
ColumnConfig icon = new ColumnConfig(ConstantsExplorer.ICON, "", 25);
ColumnConfig icon = new ColumnConfig(FileModel.ICON, "", 25);
icon.setSortable(false);
ColumnConfig name = new ColumnConfig(ConstantsExplorer.NAME, ConstantsExplorer.NAME, 300);
ColumnConfig type = new ColumnConfig(ConstantsExplorer.TYPE, ConstantsExplorer.TYPE, 50);
ColumnConfig lastUpdate = new ColumnConfig(ConstantsExplorer.LASTMODIFIED, "Last Update", 100);
ColumnConfig name = new ColumnConfig(FileGridModel.NAME, FileGridModel.NAME, 300);
ColumnConfig type = new ColumnConfig(FileGridModel.TYPE, FileGridModel.TYPE, 50);
ColumnConfig lastUpdate = new ColumnConfig(FileGridModel.LASTMODIFIED, "Last Update", 100);
lastUpdate.setDateTimeFormat(DateTimeFormat.getFormat("dd MMM hh:mm aaa yyyy"));
ColumnConfig category = new ColumnConfig(ConstantsExplorer.SHORTCUTCATEGORY, ConstantsExplorer.SHORTCUTCATEGORY, 100);
ColumnConfig size = new ColumnConfig(ConstantsExplorer.SIZE, ConstantsExplorer.SIZE, 50);
ColumnConfig ownerFullName = new ColumnConfig(ConstantsExplorer.OWNERFULLNAME, ConstantsExplorer.OWNER, 100);
ColumnConfig category = new ColumnConfig(FileModel.SHORTCUTCATEGORY, FileModel.SHORTCUTCATEGORY, 100);
ColumnConfig size = new ColumnConfig(FileGridModel.SIZE, FileGridModel.SIZE, 50);
ColumnConfig ownerFullName = new ColumnConfig(FileGridModel.OWNERFULLNAME, FileGridModel.OWNER, 100);
size.setEditor(new CellEditor(new NumberField()));
@ -113,10 +113,10 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
view.setShowGroupedColumn(false);
view.setForceFit(true);
grid.setView(view);
view.setEmptyText(ConstantsExplorer.EMPTY);
view.setEmptyText(FileGridModel.EMPTY);
if(group){
store.groupBy(ConstantsExplorer.SHORTCUTCATEGORY);
store.groupBy(FileGridModel.SHORTCUTCATEGORY);
groupingEnabled = true;
}
@ -161,10 +161,10 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
GridFilters filters = new GridFilters();
filters.setLocal(true);
StringFilter nameFilter = new StringFilter(ConstantsExplorer.NAME);
StringFilter authorFilter = new StringFilter(ConstantsExplorer.TYPE);
DateFilter dateFilter = new DateFilter(ConstantsExplorer.LASTMODIFIED);
NumericFilter sizeFilter = new NumericFilter(ConstantsExplorer.SIZE);
StringFilter nameFilter = new StringFilter(FileGridModel.NAME);
StringFilter authorFilter = new StringFilter(FileGridModel.TYPE);
DateFilter dateFilter = new DateFilter(FileGridModel.LASTMODIFIED);
NumericFilter sizeFilter = new NumericFilter(FileGridModel.SIZE);
filters.addFilter(nameFilter);
filters.addFilter(authorFilter);
@ -172,7 +172,7 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
filters.addFilter(sizeFilter);
// grid.setStyleAttribute("borderTop", "none");
grid.setAutoExpandColumn(ConstantsExplorer.NAME);
grid.setAutoExpandColumn(FileGridModel.NAME);
grid.setBorders(false);
grid.setStripeRows(true);
grid.setColumnLines(true);
@ -262,7 +262,7 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
public void disableGrouping() {
GroupingStore<FileGridModel> groupingStore = null;
if (this.getStore() instanceof GroupingStore) {
groupingStore = (GroupingStore<FileGridModel>) this.getStore();
groupingStore = this.getStore();
if (groupingStore != null) {
groupingStore.clearGrouping();
}
@ -276,9 +276,9 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
public void enableGrouping() {
GroupingStore<FileGridModel> groupingStore = null;
if (this.getStore() instanceof GroupingStore) {
groupingStore = (GroupingStore<FileGridModel>) this.getStore();
groupingStore = this.getStore();
if (groupingStore != null) {
groupingStore.groupBy(ConstantsExplorer.SHORTCUTCATEGORY);
groupingStore.groupBy(FileGridModel.SHORTCUTCATEGORY);
}
this.groupingEnabled = true;
}
@ -449,9 +449,9 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
Record record = store.getRecord(fileTarget);
if(record!=null){
if(extension!= null)
record.set(ConstantsExplorer.NAME, newName+extension);
record.set(FileGridModel.NAME, newName+extension);
else
record.set(ConstantsExplorer.NAME, newName);
record.set(FileGridModel.NAME, newName);
return true;
}
@ -501,9 +501,9 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
Record record = store.getRecord(fileTarget);
if(record!=null){
if(extension!= null)
record.set(ConstantsExplorer.NAME, newName+extension);
record.set(FileGridModel.NAME, newName+extension);
else
record.set(ConstantsExplorer.NAME, newName);
record.set(FileGridModel.NAME, newName);
return true;
}
@ -525,7 +525,7 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
* @return the file grid model by identifier
*/
public FileGridModel getFileGridModelByIdentifier(String id){
return (FileGridModel) store.findModel(ConstantsExplorer.IDENTIFIER, id);
return store.findModel(FileGridModel.IDENTIFIER, id);
}
/**

View File

@ -4,7 +4,6 @@ import java.util.Arrays;
import java.util.List;
import org.gcube.portlets.user.workspace.client.AppController;
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
import org.gcube.portlets.user.workspace.client.ConstantsPortlet;
import org.gcube.portlets.user.workspace.client.event.GridElementSelectedEvent;
import org.gcube.portlets.user.workspace.client.event.GridElementUnSelectedEvent;
@ -31,12 +30,13 @@ import com.extjs.gxt.ui.client.widget.grid.filters.GridFilters;
import com.extjs.gxt.ui.client.widget.grid.filters.StringFilter;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
/**
* This class is not used
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
/**
* The Class GxtGridFilterPanel.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Sep 15, 2016
*/
public class GxtGridFilterPanel extends LayoutContainer {
private ContentPanel cp = new ContentPanel();
@ -44,12 +44,15 @@ public class GxtGridFilterPanel extends LayoutContainer {
private FileGridModel currenItemSelected = null;
private FileModel currentFolderView = null;
/**
* Instantiates a new gxt grid filter panel.
*/
public GxtGridFilterPanel() {
setLayout(new FitLayout());
ColumnConfig name = new ColumnConfig(ConstantsExplorer.NAME, ConstantsExplorer.NAME, 400);
ColumnConfig type = new ColumnConfig(ConstantsExplorer.TYPE, ConstantsExplorer.TYPE, 100);
ColumnConfig creationDate = new ColumnConfig(ConstantsExplorer.GRIDCOLUMNCREATIONDATE, ConstantsExplorer.GRIDCOLUMNCREATIONDATE, 100);
ColumnConfig size = new ColumnConfig(ConstantsExplorer.SIZE, ConstantsExplorer.SIZE, 50);
ColumnConfig name = new ColumnConfig(FileGridModel.NAME, FileGridModel.NAME, 400);
ColumnConfig type = new ColumnConfig(FileGridModel.TYPE, FileGridModel.TYPE, 100);
ColumnConfig creationDate = new ColumnConfig(FileGridModel.GRIDCOLUMNCREATIONDATE, FileGridModel.GRIDCOLUMNCREATIONDATE, 100);
ColumnConfig size = new ColumnConfig(FileGridModel.SIZE, FileGridModel.SIZE, 50);
ColumnModel cm = new ColumnModel(Arrays.asList(name, type, creationDate, size));
@ -61,9 +64,9 @@ public class GxtGridFilterPanel extends LayoutContainer {
GridFilters filters = new GridFilters();
filters.setLocal(true);
StringFilter nameFilter = new StringFilter(ConstantsExplorer.NAME);
StringFilter authorFilter = new StringFilter(ConstantsExplorer.TYPE);
StringFilter sizeFilter = new StringFilter(ConstantsExplorer.SIZE);
StringFilter nameFilter = new StringFilter(FileGridModel.NAME);
StringFilter authorFilter = new StringFilter(FileGridModel.TYPE);
StringFilter sizeFilter = new StringFilter(FileGridModel.SIZE);
filters.addFilter(nameFilter);
filters.addFilter(authorFilter);
@ -75,7 +78,7 @@ public class GxtGridFilterPanel extends LayoutContainer {
setAlphanumericStoreSorter(grid);
grid.setAutoExpandColumn(ConstantsExplorer.NAME);
grid.setAutoExpandColumn(FileGridModel.NAME);
grid.setBorders(false);
grid.setStripeRows(true);
grid.setColumnLines(true);
@ -121,11 +124,20 @@ public class GxtGridFilterPanel extends LayoutContainer {
add(cp);
}
/**
* Reset store.
*/
private void resetStore(){
store.removeAll();
}
/**
* Update store.
*
* @param result the result
* @return true, if successful
*/
public boolean updateStore(List<FileGridModel> result){
resetStore();
@ -136,6 +148,11 @@ public class GxtGridFilterPanel extends LayoutContainer {
return false;
}
/**
* Gets the selected item.
*
* @return the selected item
*/
public FileGridModel getSelectedItem(){
return currenItemSelected;
@ -144,9 +161,10 @@ public class GxtGridFilterPanel extends LayoutContainer {
/**
* Delete item.
*
* @param identifier (MANDATORY)
* @return
* @return true, if successful
*/
public boolean deleteItem(String identifier) {
@ -165,16 +183,34 @@ public class GxtGridFilterPanel extends LayoutContainer {
}
/**
* Gets the current folder view.
*
* @return the current folder view
*/
public FileModel getCurrentFolderView() {
return currentFolderView;
}
/**
* Sets the current folder view.
*
* @param currentFolderView the new current folder view
*/
public void setCurrentFolderView(FileModel currentFolderView) {
this.currentFolderView = currentFolderView;
}
/**
* Rename item.
*
* @param itemIdentifier the item identifier
* @param newName the new name
* @param extension the extension
* @return true, if successful
*/
public boolean renameItem(String itemIdentifier, String newName, String extension) {
if(itemIdentifier!=null){
@ -184,9 +220,9 @@ public class GxtGridFilterPanel extends LayoutContainer {
Record record = store.getRecord(fileTarget);
if(record!=null){
if(extension!= null)
record.set(ConstantsExplorer.NAME, newName+extension);
record.set(FileGridModel.NAME, newName+extension);
else
record.set(ConstantsExplorer.NAME, newName);
record.set(FileGridModel.NAME, newName);
return true;
}
@ -201,6 +237,11 @@ public class GxtGridFilterPanel extends LayoutContainer {
}
/**
* Sets the alphanumeric store sorter.
*
* @param grid the new alphanumeric store sorter
*/
private void setAlphanumericStoreSorter(Grid<FileGridModel> grid){
// Sorting files
@ -222,10 +263,21 @@ public class GxtGridFilterPanel extends LayoutContainer {
});
}
/**
* Gets the file grid model by identifier.
*
* @param id the id
* @return the file grid model by identifier
*/
public FileGridModel getFileGridModelByIdentifier(String id){
return (FileGridModel) store.findModel(ConstantsExplorer.IDENTIFIER, id);
return store.findModel(FileGridModel.IDENTIFIER, id);
}
/**
* Gets the store.
*
* @return the store
*/
public ListStore<FileGridModel> getStore(){
return store;
}

View File

@ -217,7 +217,7 @@ public class GxtToolBarItemFunctionality {
toolBar.add(new SeparatorToolItem());
btnFolderLink = new Button("Folder Link", Resources.getIconFolderLink());
btnFolderLink = new Button("Folder Link", Resources.getIconFolderPublic());
btnFolderLink.setScale(ButtonScale.SMALL);
btnFolderLink.setIconAlign(IconAlign.TOP);
btnFolderLink.setArrowAlign(ButtonArrowAlign.BOTTOM);

View File

@ -5,7 +5,6 @@ import java.util.Arrays;
import java.util.List;
import org.gcube.portlets.user.workspace.client.AppController;
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
import org.gcube.portlets.user.workspace.client.event.TrashEvent;
import org.gcube.portlets.user.workspace.client.interfaces.GXTFolderItemTypeEnum;
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
@ -269,9 +268,9 @@ public class TrashInfoContainer extends LayoutContainer {
public void initGrid() {
ColumnConfig icon = new ColumnConfig(ConstantsExplorer.ICON, "", 25);
ColumnConfig name = createSortableColumnConfig(ConstantsExplorer.NAME, ConstantsExplorer.NAME, 200);
ColumnConfig type = createSortableColumnConfig(ConstantsExplorer.TYPE, ConstantsExplorer.TYPE, 80);
ColumnConfig icon = new ColumnConfig(FileGridModel.ICON, "", 25);
ColumnConfig name = createSortableColumnConfig(FileGridModel.NAME, FileGridModel.NAME, 200);
ColumnConfig type = createSortableColumnConfig(FileGridModel.TYPE, FileGridModel.TYPE, 80);
ColumnConfig originalPath = createSortableColumnConfig(FileTrashedModel.STOREINFO.ORIGINALPATH.toString(), "Original Path", 200);
ColumnConfig deleteDate = createSortableColumnConfig(FileTrashedModel.STOREINFO.DELETEDATE.toString(), "Deleted Date", 90);
deleteDate.setDateTimeFormat(DateTimeFormat.getFormat("dd MMM hh:mm aaa yyyy"));
@ -313,8 +312,8 @@ public class TrashInfoContainer extends LayoutContainer {
filters.setLocal(true);
StringFilter nameFilter = new StringFilter(ConstantsExplorer.NAME);
StringFilter typeFilter = new StringFilter(ConstantsExplorer.TYPE);
StringFilter nameFilter = new StringFilter(FileGridModel.NAME);
StringFilter typeFilter = new StringFilter(FileGridModel.TYPE);
DateFilter dateFilter = new DateFilter(FileTrashedModel.STOREINFO.DELETEDATE.toString());
filters.addFilter(nameFilter);
@ -421,7 +420,7 @@ public class TrashInfoContainer extends LayoutContainer {
*/
public FileTrashedModel getFileModelByIdentifier(String identifier){
return store.findModel(ConstantsExplorer.IDENTIFIER, identifier);
return store.findModel(FileGridModel.IDENTIFIER, identifier);
}