Updated GetInfo adding Public Folder
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@131411 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
51df7faa73
commit
9c1205118a
|
@ -292,7 +292,7 @@ public class FileModel extends BaseModelData implements Serializable {
|
||||||
|
|
||||||
}else if(this.isShared()){ //IS A SHARED FOLDER?
|
}else if(this.isShared()){ //IS A SHARED FOLDER?
|
||||||
|
|
||||||
GWT.log("setting icon 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())
|
if(this.isVreFolder())
|
||||||
absImgPr = Resources.getIconVREFolder();
|
absImgPr = Resources.getIconVREFolder();
|
||||||
|
@ -304,7 +304,7 @@ public class FileModel extends BaseModelData implements Serializable {
|
||||||
absImgPr = Resources.getIconSharedFolder();
|
absImgPr = Resources.getIconSharedFolder();
|
||||||
}else{ //IS A DESCENDANT
|
}else{ //IS A DESCENDANT
|
||||||
if(this.isPublic()) //IS PLUBIC
|
if(this.isPublic()) //IS PLUBIC
|
||||||
Resources.getIconFolderPublic();
|
absImgPr = Resources.getIconFolderPublic();
|
||||||
else
|
else
|
||||||
absImgPr = Resources.getIconFolder(); //IS A PRIVATE FOLDER
|
absImgPr = Resources.getIconFolder(); //IS A PRIVATE FOLDER
|
||||||
}
|
}
|
||||||
|
|
|
@ -1534,8 +1534,6 @@ public class Resources {
|
||||||
return Resources.getIconWorkflowReport();
|
return Resources.getIconWorkflowReport();
|
||||||
}else if(itemType.equals(GXTFolderItemTypeEnum.WORKFLOW_TEMPLATE)){
|
}else if(itemType.equals(GXTFolderItemTypeEnum.WORKFLOW_TEMPLATE)){
|
||||||
return Resources.getIconWorkflowTemplate();
|
return Resources.getIconWorkflowTemplate();
|
||||||
}else if(itemType.equals(GXTFolderItemTypeEnum.FOLDER)){
|
|
||||||
return Resources.getIconFolder();
|
|
||||||
}else if(itemType.equals(GXTFolderItemTypeEnum.EXTERNAL_RESOURCE_LINK)){
|
}else if(itemType.equals(GXTFolderItemTypeEnum.EXTERNAL_RESOURCE_LINK)){
|
||||||
return Resources.getIconResourceLink();
|
return Resources.getIconResourceLink();
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ import com.google.gwt.user.client.ui.Image;
|
||||||
public class DialogGetInfo extends Dialog {
|
public class DialogGetInfo extends Dialog {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static final String EMPTY = "empty";
|
public static final String EMPTY = "empty";
|
||||||
public static final String UNKNOWN = "unknown";
|
public static final String UNKNOWN = "unknown";
|
||||||
|
@ -52,6 +52,7 @@ public class DialogGetInfo extends Dialog {
|
||||||
private TextField<String> txtCreated = new TextField<String>();
|
private TextField<String> txtCreated = new TextField<String>();
|
||||||
private TextField<String> txtSize = new TextField<String>();
|
private TextField<String> txtSize = new TextField<String>();
|
||||||
private TextField<String> txtLocation = new TextField<String>();
|
private TextField<String> txtLocation = new TextField<String>();
|
||||||
|
private TextField<String> txtIsPublic = new TextField<String>();
|
||||||
private TextField<String> txtShared = new TextField<String>();
|
private TextField<String> txtShared = new TextField<String>();
|
||||||
// private TextArea textAreaSharedWith = new TextArea();
|
// private TextArea textAreaSharedWith = new TextArea();
|
||||||
private Html htmlUsersWidget = new Html();
|
private Html htmlUsersWidget = new Html();
|
||||||
|
@ -60,14 +61,14 @@ public class DialogGetInfo extends Dialog {
|
||||||
// private TextField<String> txtGcubeItemProperties;
|
// private TextField<String> txtGcubeItemProperties;
|
||||||
private HorizontalPanel hpGcubeProperties;
|
private HorizontalPanel hpGcubeProperties;
|
||||||
private DialogEditProperties editProperties = null;
|
private DialogEditProperties editProperties = null;
|
||||||
|
|
||||||
public DialogGetInfo(final FileModel fileModel) {
|
public DialogGetInfo(final FileModel fileModel) {
|
||||||
|
|
||||||
FormLayout layout = new FormLayout();
|
FormLayout layout = new FormLayout();
|
||||||
layout.setLabelWidth(90);
|
layout.setLabelWidth(90);
|
||||||
layout.setDefaultWidth(300);
|
layout.setDefaultWidth(300);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
|
||||||
setIcon(fileModel.getAbstractPrototypeIcon());
|
setIcon(fileModel.getAbstractPrototypeIcon());
|
||||||
setHeading(fileModel.getName() + " Properties");
|
setHeading(fileModel.getName() + " Properties");
|
||||||
|
|
||||||
|
@ -78,17 +79,17 @@ public class DialogGetInfo extends Dialog {
|
||||||
setWidth(widthDialog);
|
setWidth(widthDialog);
|
||||||
setResizable(false);
|
setResizable(false);
|
||||||
setButtons(Dialog.OK);
|
setButtons(Dialog.OK);
|
||||||
|
|
||||||
txtName = new TextField<String>();
|
txtName = new TextField<String>();
|
||||||
txtName.setFieldLabel("Name");
|
txtName.setFieldLabel("Name");
|
||||||
txtName.setReadOnly(true);
|
txtName.setReadOnly(true);
|
||||||
textFieldSetValue(txtName,fileModel.getName());
|
textFieldSetValue(txtName,fileModel.getName());
|
||||||
add(txtName);
|
add(txtName);
|
||||||
|
|
||||||
txtLocation = new TextField<String>();
|
txtLocation = new TextField<String>();
|
||||||
txtLocation.setFieldLabel("Location");
|
txtLocation.setFieldLabel("Location");
|
||||||
txtLocation.setReadOnly(true);
|
txtLocation.setReadOnly(true);
|
||||||
|
|
||||||
if(fileModel.isRoot())
|
if(fileModel.isRoot())
|
||||||
txtLocation.setValue("/");
|
txtLocation.setValue("/");
|
||||||
else
|
else
|
||||||
|
@ -96,11 +97,19 @@ public class DialogGetInfo extends Dialog {
|
||||||
|
|
||||||
add(txtLocation);
|
add(txtLocation);
|
||||||
|
|
||||||
|
if(fileModel.isDirectory()){
|
||||||
|
txtIsPublic = new TextField<String>();
|
||||||
|
txtIsPublic.setFieldLabel("Public Folder");
|
||||||
|
txtIsPublic.setReadOnly(true);
|
||||||
|
txtIsPublic.setValue(fileModel.isPublic()+"");
|
||||||
|
add(txtIsPublic);
|
||||||
|
}
|
||||||
|
|
||||||
txtAreaDescription.setFieldLabel("Description");
|
txtAreaDescription.setFieldLabel("Description");
|
||||||
txtAreaDescription.setHeight(30);
|
txtAreaDescription.setHeight(30);
|
||||||
txtAreaDescription.setReadOnly(true);
|
txtAreaDescription.setReadOnly(true);
|
||||||
add(txtAreaDescription);
|
add(txtAreaDescription);
|
||||||
|
|
||||||
//GCUBE PROPERTIES
|
//GCUBE PROPERTIES
|
||||||
hpGcubeProperties = new HorizontalPanel();
|
hpGcubeProperties = new HorizontalPanel();
|
||||||
hpGcubeProperties.setStyleAttribute("padding-top", "6px");
|
hpGcubeProperties.setStyleAttribute("padding-top", "6px");
|
||||||
|
@ -112,33 +121,33 @@ public class DialogGetInfo extends Dialog {
|
||||||
loadGcubeItemProperties(fileModel.getIdentifier());
|
loadGcubeItemProperties(fileModel.getIdentifier());
|
||||||
htmlPropertiesWidget.setHeight(heightTextArea);
|
htmlPropertiesWidget.setHeight(heightTextArea);
|
||||||
htmlPropertiesWidget.setWidth("275px");
|
htmlPropertiesWidget.setWidth("275px");
|
||||||
|
|
||||||
LayoutContainer lc = new LayoutContainer();
|
LayoutContainer lc = new LayoutContainer();
|
||||||
lc.addStyleName("editPermissions");
|
lc.addStyleName("editPermissions");
|
||||||
|
|
||||||
Image imgProperties = Resources.getIconEdit().createImage(); //EDIT PROPERTIES
|
Image imgProperties = Resources.getIconEdit().createImage(); //EDIT PROPERTIES
|
||||||
imgProperties.setTitle("Edit Properties");
|
imgProperties.setTitle("Edit Properties");
|
||||||
lc.add(imgProperties);
|
lc.add(imgProperties);
|
||||||
|
|
||||||
hpGcubeProperties.add(lc);
|
hpGcubeProperties.add(lc);
|
||||||
|
|
||||||
final Command cmdReloadProperties = new Command() {
|
final Command cmdReloadProperties = new Command() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
loadGcubeItemProperties(fileModel.getIdentifier());
|
loadGcubeItemProperties(fileModel.getIdentifier());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
imgProperties.addClickHandler(new ClickHandler() {
|
imgProperties.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
if(editProperties==null)
|
if(editProperties==null)
|
||||||
editProperties = new DialogEditProperties(fileModel, cmdReloadProperties);
|
editProperties = new DialogEditProperties(fileModel, cmdReloadProperties);
|
||||||
|
|
||||||
editProperties.show();
|
editProperties.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
htmlPropertiesWidget.setStyleAttribute("margin-left", "5px");
|
htmlPropertiesWidget.setStyleAttribute("margin-left", "5px");
|
||||||
|
@ -146,19 +155,19 @@ public class DialogGetInfo extends Dialog {
|
||||||
hpGcubeProperties.setScrollMode(Scroll.AUTOY);
|
hpGcubeProperties.setScrollMode(Scroll.AUTOY);
|
||||||
add(hpGcubeProperties);
|
add(hpGcubeProperties);
|
||||||
setVisibleGcubeProperties(false);
|
setVisibleGcubeProperties(false);
|
||||||
|
|
||||||
if(fileModel.isDirectory()){
|
if(fileModel.isDirectory()){
|
||||||
txtAreaDescription.setValue(fileModel.getDescription());
|
txtAreaDescription.setValue(fileModel.getDescription());
|
||||||
// add(txtAreaDescription);
|
// add(txtAreaDescription);
|
||||||
}else
|
}else
|
||||||
loadDescription(fileModel.getIdentifier());
|
loadDescription(fileModel.getIdentifier());
|
||||||
|
|
||||||
txtType = new TextField<String>();
|
txtType = new TextField<String>();
|
||||||
txtType.setFieldLabel("Type");
|
txtType.setFieldLabel("Type");
|
||||||
txtType.setReadOnly(true);
|
txtType.setReadOnly(true);
|
||||||
textFieldSetValue(txtType,fileModel.getType());
|
textFieldSetValue(txtType,fileModel.getType());
|
||||||
add(txtType);
|
add(txtType);
|
||||||
|
|
||||||
txtCategory = new TextField<String>();
|
txtCategory = new TextField<String>();
|
||||||
txtCategory.setFieldLabel("Category");
|
txtCategory.setFieldLabel("Category");
|
||||||
txtCategory.setReadOnly(true);
|
txtCategory.setReadOnly(true);
|
||||||
|
@ -176,9 +185,9 @@ public class DialogGetInfo extends Dialog {
|
||||||
txtCreated.setReadOnly(true);
|
txtCreated.setReadOnly(true);
|
||||||
|
|
||||||
loadCreationDate(fileModel.getIdentifier());
|
loadCreationDate(fileModel.getIdentifier());
|
||||||
|
|
||||||
add(txtCreated);
|
add(txtCreated);
|
||||||
|
|
||||||
txtLastMofication = new TextField<String>();
|
txtLastMofication = new TextField<String>();
|
||||||
txtLastMofication.setFieldLabel("Last Mofication");
|
txtLastMofication.setFieldLabel("Last Mofication");
|
||||||
txtLastMofication.setReadOnly(true);
|
txtLastMofication.setReadOnly(true);
|
||||||
|
@ -186,30 +195,30 @@ public class DialogGetInfo extends Dialog {
|
||||||
textFieldSetValue(txtLastMofication, ((FileGridModel) fileModel).getLastModification().toString());
|
textFieldSetValue(txtLastMofication, ((FileGridModel) fileModel).getLastModification().toString());
|
||||||
else
|
else
|
||||||
loadLastModificationDate(fileModel.getIdentifier());
|
loadLastModificationDate(fileModel.getIdentifier());
|
||||||
|
|
||||||
add(txtLastMofication);
|
add(txtLastMofication);
|
||||||
|
|
||||||
txtSize = new TextField<String>();
|
txtSize = new TextField<String>();
|
||||||
txtSize.setFieldLabel("Size");
|
txtSize.setFieldLabel("Size");
|
||||||
txtSize.setReadOnly(true);
|
txtSize.setReadOnly(true);
|
||||||
|
|
||||||
if(fileModel instanceof FileGridModel)
|
if(fileModel instanceof FileGridModel)
|
||||||
textFieldSetValue(txtSize,getFormattedSize(((FileGridModel) fileModel).getSize()));
|
textFieldSetValue(txtSize,getFormattedSize(((FileGridModel) fileModel).getSize()));
|
||||||
else
|
else
|
||||||
loadSize(fileModel.getIdentifier());
|
loadSize(fileModel.getIdentifier());
|
||||||
|
|
||||||
add(txtSize);
|
add(txtSize);
|
||||||
|
|
||||||
//SHARED
|
//SHARED
|
||||||
txtShared = new TextField<String>();
|
txtShared = new TextField<String>();
|
||||||
txtShared.setFieldLabel("Shared");
|
txtShared.setFieldLabel("Shared");
|
||||||
txtShared.setReadOnly(true);
|
txtShared.setReadOnly(true);
|
||||||
textFieldSetValue(txtShared,fileModel.isShared()+"");
|
textFieldSetValue(txtShared,fileModel.isShared()+"");
|
||||||
add(txtShared);
|
add(txtShared);
|
||||||
|
|
||||||
//USERS SHARED
|
//USERS SHARED
|
||||||
if(fileModel.isShared()){
|
if(fileModel.isShared()){
|
||||||
|
|
||||||
HorizontalPanel hp = new HorizontalPanel();
|
HorizontalPanel hp = new HorizontalPanel();
|
||||||
hp.setStyleAttribute("padding-top", "6px");
|
hp.setStyleAttribute("padding-top", "6px");
|
||||||
Label label = new Label("Shared with");
|
Label label = new Label("Shared with");
|
||||||
|
@ -222,8 +231,8 @@ public class DialogGetInfo extends Dialog {
|
||||||
hp.setScrollMode(Scroll.AUTOY);
|
hp.setScrollMode(Scroll.AUTOY);
|
||||||
add(hp);
|
add(hp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.getButtonById(Dialog.OK).addSelectionListener(new SelectionListener<ButtonEvent>() {
|
this.getButtonById(Dialog.OK).addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -233,23 +242,23 @@ public class DialogGetInfo extends Dialog {
|
||||||
});
|
});
|
||||||
this.show();
|
this.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setVisibleGcubeProperties(boolean bool){
|
private void setVisibleGcubeProperties(boolean bool){
|
||||||
hpGcubeProperties.setVisible(bool);
|
hpGcubeProperties.setVisible(bool);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param identifier
|
* @param identifier
|
||||||
*/
|
*/
|
||||||
private void loadDescription(String identifier) {
|
private void loadDescription(String identifier) {
|
||||||
txtAreaDescription.mask();
|
txtAreaDescription.mask();
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getItemDescriptionById(identifier, new AsyncCallback<String>() {
|
AppControllerExplorer.rpcWorkspaceService.getItemDescriptionById(identifier, new AsyncCallback<String>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable arg0) {
|
public void onFailure(Throwable arg0) {
|
||||||
txtAreaDescription.unmask();
|
txtAreaDescription.unmask();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -258,16 +267,16 @@ public class DialogGetInfo extends Dialog {
|
||||||
txtAreaDescription.setValue(result);
|
txtAreaDescription.setValue(result);
|
||||||
else
|
else
|
||||||
txtAreaDescription.setValue("");
|
txtAreaDescription.setValue("");
|
||||||
|
|
||||||
txtAreaDescription.unmask();
|
txtAreaDescription.unmask();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadLastModificationDate(final String itemId) {
|
private void loadLastModificationDate(final String itemId) {
|
||||||
|
|
||||||
txtLastMofication.mask();
|
txtLastMofication.mask();
|
||||||
AppControllerExplorer.rpcWorkspaceService.loadLastModificationDateById(itemId, new AsyncCallback<Date>() {
|
AppControllerExplorer.rpcWorkspaceService.loadLastModificationDateById(itemId, new AsyncCallback<Date>() {
|
||||||
|
|
||||||
|
@ -275,33 +284,33 @@ public class DialogGetInfo extends Dialog {
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
GWT.log("an error occured in loadLastModificationDateById "+itemId + " "+caught.getMessage());
|
GWT.log("an error occured in loadLastModificationDateById "+itemId + " "+caught.getMessage());
|
||||||
txtLastMofication.unmask();
|
txtLastMofication.unmask();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Date result) {
|
public void onSuccess(Date result) {
|
||||||
|
|
||||||
if(result!=null)
|
if(result!=null)
|
||||||
txtLastMofication.setValue(result.toString());
|
txtLastMofication.setValue(result.toString());
|
||||||
else
|
else
|
||||||
txtLastMofication.setValue(UNKNOWN);
|
txtLastMofication.setValue(UNKNOWN);
|
||||||
|
|
||||||
txtLastMofication.unmask();
|
txtLastMofication.unmask();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void textFieldSetValue(TextField<String> field, String value){
|
private void textFieldSetValue(TextField<String> field, String value){
|
||||||
|
|
||||||
if(value==null || value.isEmpty())
|
if(value==null || value.isEmpty())
|
||||||
field.setValue(UNKNOWN);
|
field.setValue(UNKNOWN);
|
||||||
else
|
else
|
||||||
field.setValue(value);
|
field.setValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadOwner(final String itemId){
|
private void loadOwner(final String itemId){
|
||||||
|
|
||||||
txtOwner.mask();
|
txtOwner.mask();
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getOwnerByItemId(itemId, new AsyncCallback<InfoContactModel>() {
|
AppControllerExplorer.rpcWorkspaceService.getOwnerByItemId(itemId, new AsyncCallback<InfoContactModel>() {
|
||||||
|
@ -319,9 +328,9 @@ public class DialogGetInfo extends Dialog {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void loadGcubeItemProperties(final String itemId){
|
private void loadGcubeItemProperties(final String itemId){
|
||||||
GWT.log("Load GcubeItemProperties");
|
GWT.log("Load GcubeItemProperties");
|
||||||
htmlPropertiesWidget.mask();
|
htmlPropertiesWidget.mask();
|
||||||
|
@ -332,7 +341,7 @@ public class DialogGetInfo extends Dialog {
|
||||||
htmlPropertiesWidget.unmask();
|
htmlPropertiesWidget.unmask();
|
||||||
GWT.log("an error occured in load properties by Id "+itemId + " "+caught.getMessage());
|
GWT.log("an error occured in load properties by Id "+itemId + " "+caught.getMessage());
|
||||||
setVisibleGcubeProperties(true);
|
setVisibleGcubeProperties(true);
|
||||||
htmlPropertiesWidget.setHtml("Error on recovering properties");
|
htmlPropertiesWidget.setHtml("Error on recovering properties");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -350,8 +359,8 @@ public class DialogGetInfo extends Dialog {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void loadSize(final String itemId){
|
private void loadSize(final String itemId){
|
||||||
GWT.log("Load size");
|
GWT.log("Load size");
|
||||||
txtSize.mask();
|
txtSize.mask();
|
||||||
|
@ -361,7 +370,7 @@ public class DialogGetInfo extends Dialog {
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
GWT.log("an error occured in load creation date by Id "+itemId + " "+caught.getMessage());
|
GWT.log("an error occured in load creation date by Id "+itemId + " "+caught.getMessage());
|
||||||
txtSize.unmask();
|
txtSize.unmask();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -372,10 +381,10 @@ public class DialogGetInfo extends Dialog {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void loadCreationDate(final String itemId){
|
private void loadCreationDate(final String itemId){
|
||||||
|
|
||||||
txtCreated.mask();
|
txtCreated.mask();
|
||||||
AppControllerExplorer.rpcWorkspaceService.getItemCreationDateById(itemId, new AsyncCallback<Date>() {
|
AppControllerExplorer.rpcWorkspaceService.getItemCreationDateById(itemId, new AsyncCallback<Date>() {
|
||||||
|
|
||||||
|
@ -389,23 +398,23 @@ public class DialogGetInfo extends Dialog {
|
||||||
public void onSuccess(Date result) {
|
public void onSuccess(Date result) {
|
||||||
if(result!=null)
|
if(result!=null)
|
||||||
textFieldSetValue(txtCreated,result.toString());
|
textFieldSetValue(txtCreated,result.toString());
|
||||||
|
|
||||||
txtCreated.unmask();
|
txtCreated.unmask();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadACLsDescriptionForSharedFolder(String sharedId){
|
private void loadACLsDescriptionForSharedFolder(String sharedId){
|
||||||
|
|
||||||
htmlUsersWidget.mask();
|
htmlUsersWidget.mask();
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getACLsDescriptionForWorkspaceItemById(sharedId, new AsyncCallback<String>() {
|
AppControllerExplorer.rpcWorkspaceService.getACLsDescriptionForWorkspaceItemById(sharedId, new AsyncCallback<String>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
htmlUsersWidget.unmask();
|
htmlUsersWidget.unmask();
|
||||||
htmlUsersWidget.setHtml("Error on recovering users");
|
htmlUsersWidget.setHtml("Error on recovering users");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -415,9 +424,9 @@ public class DialogGetInfo extends Dialog {
|
||||||
htmlUsersWidget.setHtml(result);
|
htmlUsersWidget.setHtml(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getFormattedSize(long value){
|
private String getFormattedSize(long value){
|
||||||
|
|
||||||
if(value>0){
|
if(value>0){
|
||||||
|
@ -430,9 +439,9 @@ public class DialogGetInfo extends Dialog {
|
||||||
}else
|
}else
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadLocation(String itemId){
|
private void loadLocation(String itemId){
|
||||||
|
|
||||||
txtLocation.mask();
|
txtLocation.mask();
|
||||||
AppControllerExplorer.rpcWorkspaceService.getListParentsByItemIdentifier(itemId, false, new AsyncCallback<List<FileModel>>() {
|
AppControllerExplorer.rpcWorkspaceService.getListParentsByItemIdentifier(itemId, false, new AsyncCallback<List<FileModel>>() {
|
||||||
|
|
||||||
|
@ -444,22 +453,22 @@ public class DialogGetInfo extends Dialog {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<FileModel> result) {
|
public void onSuccess(List<FileModel> result) {
|
||||||
|
|
||||||
String location="";
|
String location="";
|
||||||
|
|
||||||
if(result!=null){
|
if(result!=null){
|
||||||
|
|
||||||
for (FileModel fileModel : result) {
|
for (FileModel fileModel : result) {
|
||||||
location+="/"+fileModel.getName();
|
location+="/"+fileModel.getName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(location.isEmpty())
|
if(location.isEmpty())
|
||||||
location ="/";
|
location ="/";
|
||||||
|
|
||||||
txtLocation.setValue(location);
|
txtLocation.setValue(location);
|
||||||
txtLocation.unmask();
|
txtLocation.unmask();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -56,7 +56,6 @@ public class DialogGetLink extends Dialog {
|
||||||
public DialogGetLink(String headingTxt, final FileModel item, Link_Type type) {
|
public DialogGetLink(String headingTxt, final FileModel item, Link_Type type) {
|
||||||
this.item = item;
|
this.item = item;
|
||||||
setButtonAlign(HorizontalAlignment.CENTER);
|
setButtonAlign(HorizontalAlignment.CENTER);
|
||||||
setIcon(Resources.getIconPublicLink());
|
|
||||||
vp.setHorizontalAlign(HorizontalAlignment.CENTER);
|
vp.setHorizontalAlign(HorizontalAlignment.CENTER);
|
||||||
vp.setVerticalAlign(VerticalAlignment.MIDDLE);
|
vp.setVerticalAlign(VerticalAlignment.MIDDLE);
|
||||||
vp.getElement().getStyle().setPadding(1, Unit.PX);
|
vp.getElement().getStyle().setPadding(1, Unit.PX);
|
||||||
|
@ -95,6 +94,7 @@ public class DialogGetLink extends Dialog {
|
||||||
case PUBLIC_LINK:
|
case PUBLIC_LINK:
|
||||||
|
|
||||||
vp.mask("Getting Public Link...");
|
vp.mask("Getting Public Link...");
|
||||||
|
setIcon(Resources.getIconPublicLink());
|
||||||
|
|
||||||
if(item.getIdentifier()!=null && !item.getIdentifier().isEmpty()){
|
if(item.getIdentifier()!=null && !item.getIdentifier().isEmpty()){
|
||||||
AppControllerExplorer.rpcWorkspaceService.getPublicLinkForFolderItemId(item.getIdentifier(), true, new AsyncCallback<PublicLink>() {
|
AppControllerExplorer.rpcWorkspaceService.getPublicLinkForFolderItemId(item.getIdentifier(), true, new AsyncCallback<PublicLink>() {
|
||||||
|
@ -129,6 +129,11 @@ public class DialogGetLink extends Dialog {
|
||||||
case FOLDER_LINK:
|
case FOLDER_LINK:
|
||||||
|
|
||||||
vp.mask("Getting Folder Link... checking permissions");
|
vp.mask("Getting Folder Link... checking permissions");
|
||||||
|
if(item.isShared()){
|
||||||
|
setIcon(Resources.getIconFolderSharedPublic());
|
||||||
|
}else
|
||||||
|
setIcon(Resources.getIconFolderPublic());
|
||||||
|
|
||||||
if(item.getIdentifier()!=null && !item.getIdentifier().isEmpty()){
|
if(item.getIdentifier()!=null && !item.getIdentifier().isEmpty()){
|
||||||
AppControllerExplorer.rpcWorkspaceService.getOwnerByItemId(item.getIdentifier(), new AsyncCallback<InfoContactModel>() {
|
AppControllerExplorer.rpcWorkspaceService.getOwnerByItemId(item.getIdentifier(), new AsyncCallback<InfoContactModel>() {
|
||||||
|
|
||||||
|
|
|
@ -574,7 +574,7 @@ public class GWTWorkspaceBuilder {
|
||||||
switch (item.getType()) {
|
switch (item.getType()) {
|
||||||
|
|
||||||
case FOLDER: fileModel = new FolderModel(item.getId(), item.getName(), true, false);
|
case FOLDER: fileModel = new FolderModel(item.getId(), item.getName(), true, false);
|
||||||
fileModel.setType(GXTFolderItemTypeEnum.FOLDER.toString());
|
fileModel.setType(GXTFolderItemTypeEnum.FOLDER.getLabel());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FOLDER_ITEM:
|
case FOLDER_ITEM:
|
||||||
|
@ -590,7 +590,7 @@ public class GWTWorkspaceBuilder {
|
||||||
|
|
||||||
fileModel = new FolderModel(item.getId(), name, true, shared.isVreFolder());
|
fileModel = new FolderModel(item.getId(), name, true, shared.isVreFolder());
|
||||||
fileModel.setShared(true);
|
fileModel.setShared(true);
|
||||||
fileModel.setType(GXTFolderItemTypeEnum.FOLDER_SHARED.toString());
|
fileModel.setType(GXTFolderItemTypeEnum.FOLDER_SHARED.getLabel());
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -681,11 +681,11 @@ public class GWTWorkspaceBuilder {
|
||||||
boolean isPublic = ((WorkspaceFolder) item).isPublic();
|
boolean isPublic = ((WorkspaceFolder) item).isPublic();
|
||||||
fileModel = new FolderModel(item.getId(), item.getName(), parentFolderModel, true, false, false, isPublic);
|
fileModel = new FolderModel(item.getId(), item.getName(), parentFolderModel, true, false, false, isPublic);
|
||||||
if(isPublic)
|
if(isPublic)
|
||||||
fileModel.setType(GXTFolderItemTypeEnum.FOLDER_PUBLIC.toString());
|
fileModel.setType(GXTFolderItemTypeEnum.FOLDER_PUBLIC.getLabel());
|
||||||
else
|
else
|
||||||
fileModel.setType(GXTFolderItemTypeEnum.FOLDER.toString());
|
fileModel.setType(GXTFolderItemTypeEnum.FOLDER.getLabel());
|
||||||
|
|
||||||
fileModel.setType(GXTFolderItemTypeEnum.FOLDER.toString());
|
fileModel.setType(GXTFolderItemTypeEnum.FOLDER.getLabel());
|
||||||
fileModel.setShareable(true);
|
fileModel.setShareable(true);
|
||||||
fileModel.setDescription(item.getDescription());
|
fileModel.setDescription(item.getDescription());
|
||||||
break;
|
break;
|
||||||
|
@ -764,7 +764,7 @@ public class GWTWorkspaceBuilder {
|
||||||
|
|
||||||
case FOLDER:
|
case FOLDER:
|
||||||
fileGridModel = new FolderGridModel(item.getId(), item.getName(), toDate(item.getLastModified()), parentFileModel, -1, true, false,false, false);
|
fileGridModel = new FolderGridModel(item.getId(), item.getName(), toDate(item.getLastModified()), parentFileModel, -1, true, false,false, false);
|
||||||
fileGridModel.setType(GXTFolderItemTypeEnum.FOLDER.toString());
|
fileGridModel.setType(GXTFolderItemTypeEnum.FOLDER.getLabel());
|
||||||
fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_FOLDERS);
|
fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_FOLDERS);
|
||||||
fileGridModel.setShareable(true);
|
fileGridModel.setShareable(true);
|
||||||
break;
|
break;
|
||||||
|
@ -778,7 +778,7 @@ public class GWTWorkspaceBuilder {
|
||||||
case SHARED_FOLDER:
|
case SHARED_FOLDER:
|
||||||
//ATTENTION: SEARCH ITEM IS NOT CASTABLE AT WorkspaceSharedFolder
|
//ATTENTION: SEARCH ITEM IS NOT CASTABLE AT WorkspaceSharedFolder
|
||||||
fileGridModel = new FolderGridModel(item.getId(), item.getName(), toDate(item.getLastModified()), parentFileModel, -1, true, true, item.isVreFolder(), false);
|
fileGridModel = new FolderGridModel(item.getId(), item.getName(), toDate(item.getLastModified()), parentFileModel, -1, true, true, item.isVreFolder(), false);
|
||||||
fileGridModel.setType(GXTFolderItemTypeEnum.FOLDER_SHARED.toString());
|
fileGridModel.setType(GXTFolderItemTypeEnum.FOLDER_SHARED.getLabel());
|
||||||
fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_SHARED_FOLDERS);
|
fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_SHARED_FOLDERS);
|
||||||
fileGridModel.setShareable(true);
|
fileGridModel.setShareable(true);
|
||||||
break;
|
break;
|
||||||
|
@ -857,9 +857,9 @@ public class GWTWorkspaceBuilder {
|
||||||
boolean isPublic = ((WorkspaceFolder)item).isPublic();
|
boolean isPublic = ((WorkspaceFolder)item).isPublic();
|
||||||
fileGridModel = new FolderGridModel(item.getId(), item.getName(), toDate(item.getLastModificationTime()), parentFileModel, -1, true, false,false, isPublic);
|
fileGridModel = new FolderGridModel(item.getId(), item.getName(), toDate(item.getLastModificationTime()), parentFileModel, -1, true, false,false, isPublic);
|
||||||
if(isPublic)
|
if(isPublic)
|
||||||
fileGridModel.setType(GXTFolderItemTypeEnum.FOLDER_PUBLIC.toString());
|
fileGridModel.setType(GXTFolderItemTypeEnum.FOLDER_PUBLIC.getLabel().toString());
|
||||||
else
|
else
|
||||||
fileGridModel.setType(GXTFolderItemTypeEnum.FOLDER.toString());
|
fileGridModel.setType(GXTFolderItemTypeEnum.FOLDER.getLabel().toString());
|
||||||
|
|
||||||
fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_FOLDERS);
|
fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_FOLDERS);
|
||||||
fileGridModel.setShareable(true);
|
fileGridModel.setShareable(true);
|
||||||
|
@ -879,9 +879,9 @@ public class GWTWorkspaceBuilder {
|
||||||
fileGridModel = new FolderGridModel(item.getId(), name, toDate(item.getLastModificationTime()), parentFileModel, -1, true, true, shared.isVreFolder(), isPublic);
|
fileGridModel = new FolderGridModel(item.getId(), name, toDate(item.getLastModificationTime()), parentFileModel, -1, true, true, shared.isVreFolder(), isPublic);
|
||||||
|
|
||||||
if(isPublic)
|
if(isPublic)
|
||||||
fileGridModel.setType(GXTFolderItemTypeEnum.FOLDER_SHARED_PUBLIC.toString());
|
fileGridModel.setType(GXTFolderItemTypeEnum.FOLDER_SHARED_PUBLIC.getLabel().toString());
|
||||||
else
|
else
|
||||||
fileGridModel.setType(GXTFolderItemTypeEnum.FOLDER_SHARED.toString());
|
fileGridModel.setType(GXTFolderItemTypeEnum.FOLDER_SHARED.getLabel().toString());
|
||||||
|
|
||||||
fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_SHARED_FOLDERS);
|
fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_SHARED_FOLDERS);
|
||||||
fileGridModel.setShareable(true);
|
fileGridModel.setShareable(true);
|
||||||
|
|
Loading…
Reference in New Issue