git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@181830 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2019-09-24 09:28:28 +00:00
parent 97c16c7e13
commit 82eb3458cb
4 changed files with 86 additions and 34 deletions

View File

@ -116,7 +116,7 @@ public class DialogShareableLink extends Composite {
private boolean itemIsPublicStatus; private boolean itemIsPublicStatus;
private final String privateShareToFileDescription = "By sharing the following Private Link " private final String privateShareToFileDescription = "By sharing the following Private Link "
+ "to file with your coworkers, you will enact users (only the members belonging to the shared folder), " + "to file with your coworkers, you will enact the users of the group the folder is shared with, "
+ "after login, to access the file and the shared folder content"; + "after login, to access the file and the shared folder content";
@ -201,6 +201,7 @@ public class DialogShareableLink extends Composite {
alertFolderPublicLink.setVisible(false); alertFolderPublicLink.setVisible(false);
filedEnableDisableSharing.setVisible(false); filedEnableDisableSharing.setVisible(false);
buttonShareSettings.setVisible(false); buttonShareSettings.setVisible(false);
switchButton.setVisible(true);
//panelFieldsContainer.setVisible(false); //panelFieldsContainer.setVisible(false);
showMessage("", false); showMessage("", false);
this.itemIsPublicStatus = item.isPublic(); this.itemIsPublicStatus = item.isPublic();
@ -237,6 +238,14 @@ public class DialogShareableLink extends Composite {
//THE FOLDER IS PRIVATE - NO SHARED AND NO PUBLIC //THE FOLDER IS PRIVATE - NO SHARED AND NO PUBLIC
if(!item.isPublic() && !item.isShared()) { if(!item.isPublic() && !item.isShared()) {
//SHARING WITH COWORKERS
if(item.isShareable()) {
fieldPrivateSharing.setVisible(true);
buttonShareSettings.setVisible(true);
}
//SHARING WITH EVERYONE
filedEnableDisableSharing.setVisible(true); filedEnableDisableSharing.setVisible(true);
alertFolderPublicLink.setVisible(true); alertFolderPublicLink.setVisible(true);
labelLinkSharing.setText("The folder is private, not shared"); labelLinkSharing.setText("The folder is private, not shared");
@ -245,8 +254,10 @@ public class DialogShareableLink extends Composite {
}else { //CASE FILE - MANAGING AS PUBLIC LINK TO FILE }else { //CASE FILE - MANAGING AS PUBLIC LINK TO FILE
//panelFieldsContainer.setVisible(true); //panelFieldsContainer.setVisible(true);
cgPublicLink.setVisible(true); cgPublicLink.setVisible(true);
filedEnableDisableSharing.setVisible(true);
alertFilePublicLink.setVisible(true); alertFilePublicLink.setVisible(true);
if(!item.isPublic()) { //THE FILE IS PRIVATE if(!item.isPublic()) { //THE FILE IS PRIVATE
switchButton.setVisible(false);
if(version!=null && !version.isEmpty()) { if(version!=null && !version.isEmpty()) {
showPublicLinkForFileItemIdToVersion(item, textPublicLink, version); showPublicLinkForFileItemIdToVersion(item, textPublicLink, version);
}else { }else {
@ -272,14 +283,33 @@ public class DialogShareableLink extends Composite {
* @param item the item * @param item the item
* @param toTextBox the to text box * @param toTextBox the to text box
*/ */
private void loadAndShowPrivateLink(FileModel item, TextBox toTextBox) { private void loadAndShowPrivateLink(FileModel item, final TextBox toTextBox) {
String currentUrl = portalURL(); String currentUrl = portalURL();
int lastChar = currentUrl.lastIndexOf("?"); int lastChar = currentUrl.lastIndexOf("?");
currentUrl = lastChar > -1 ? currentUrl.substring(0, lastChar) : currentUrl; currentUrl = lastChar > -1 ? currentUrl.substring(0, lastChar) : currentUrl;
String shareLinkUrl = currentUrl + "?" + ConstantsExplorer.GET_ITEMID_PARAMETER + "=" + item.getIdentifier(); String shareLinkUrl = currentUrl + "?" + ConstantsExplorer.GET_ITEMID_PARAMETER + "=" + item.getIdentifier();
shareLinkUrl += "&" + ConstantsExplorer.GET_OPERATION_PARAMETER + "=" + WsPortletInitOperation.gotofolder; shareLinkUrl += "&" + ConstantsExplorer.GET_OPERATION_PARAMETER + "=" + WsPortletInitOperation.gotofolder;
toTextBox.setText(shareLinkUrl);
final String longURL = shareLinkUrl;
AppControllerExplorer.rpcWorkspaceService.getShortUrl(shareLinkUrl, new AsyncCallback<String>() {
@Override
public void onFailure(Throwable caught) {
toTextBox.setText(longURL);
}
@Override
public void onSuccess(String shorURL) {
if(shorURL!=null && !shorURL.isEmpty()) {
toTextBox.setText(shorURL);
}else {
toTextBox.setText(longURL);
}
}
});
} }
/** /**

View File

@ -4,10 +4,6 @@
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"
xmlns:citem="urn:import:org.gcube.portlets.widgets.switchbutton.client"> xmlns:citem="urn:import:org.gcube.portlets.widgets.switchbutton.client">
<ui:style> <ui:style>
.textbox-width {
width: 200px;
}
.back-color-info { .back-color-info {
background-color: #fafaff !important; background-color: #fafaff !important;
} }
@ -43,6 +39,11 @@
vertical-align: top; vertical-align: top;
padding-top: 0px !important; padding-top: 0px !important;
} }
.no-border {
border: 0px;
}
</ui:style> </ui:style>
<g:HTMLPanel> <g:HTMLPanel>
<b:Form type="HORIZONTAL"> <b:Form type="HORIZONTAL">
@ -54,41 +55,43 @@
<g:VerticalPanel ui:field="fieldPrivateSharing" <g:VerticalPanel ui:field="fieldPrivateSharing"
addStyleNames="{style.margin-bottom-20}"> addStyleNames="{style.margin-bottom-20}">
<g:HorizontalPanel> <g:HorizontalPanel>
<b:Label type="INFO" addStyleNames="{style.font-size-14}">Link Sharing with <b:Label type="INFO" addStyleNames="{style.font-size-14}">Link shareable with
Coworkers</b:Label> coworkers</b:Label>
<citem:SwitchButton <citem:SwitchButton
ui:field="switchButtonPrivate" addStyleNames="{style.not-active}" ui:field="switchButtonPrivate" addStyleNames="{style.not-active}"
visible="false"></citem:SwitchButton> visible="false"></citem:SwitchButton>
<b:Button addStyleNames="{style.padding-left-10} {style.to-top-alignment}" type="LINK" ui:field="buttonShareSettings">Share settings</b:Button> <b:Button
addStyleNames="{style.padding-left-10} {style.to-top-alignment}"
type="LINK" ui:field="buttonShareSettings">Share settings</b:Button>
</g:HorizontalPanel> </g:HorizontalPanel>
<g:VerticalPanel <g:VerticalPanel
addStyleNames="{style.margin-left-5}"> addStyleNames="{style.margin-left-5}">
<g:Label ui:field="labelLinkPrivateSharing">(Only the) Members belonging to the <g:Label ui:field="labelLinkPrivateSharing">(Only the) Members of the group the
share folder is shared with are enacted to view</g:Label>
can view</g:Label>
</g:VerticalPanel> </g:VerticalPanel>
</g:VerticalPanel> </g:VerticalPanel>
<b:Fieldset ui:field="fieldSetPrivate"> <b:Fieldset ui:field="fieldSetPrivate"
styleName="{style.noBorder}">
<g:HTMLPanel> <g:HTMLPanel>
<!-- <b:Legend>sharing....</b:Legend> --> <!-- <b:Legend>sharing....</b:Legend> -->
<b:ControlGroup ui:field="cgPrivateLink"> <b:ControlGroup ui:field="cgPrivateLink"
addStyleNames="my-control-group">
<b:Well ui:field="wellPrivateLinkDescription"> <b:Well ui:field="wellPrivateLinkDescription">
By sharing the following Private Link By sharing the following Private Link
to folder with to
folder with
your your
coworkers, coworkers,
you will you will enact the users of the group
enact users (only the members belonging to the the folder is shared with,
shared after login, to access the shared
folder), folder content</b:Well>
after login, to access
the
content</b:Well>
<b:ControlLabel>Private Link</b:ControlLabel> <b:ControlLabel>Private Link</b:ControlLabel>
<b:Controls> <b:Controls>
<b:InputAddOn prependIcon="LINK"> <b:InputAddOn prependIcon="LINK"
addStyleNames="my-prepend-width">
<b:TextBox ui:field="textPrivateLink" readOnly="true"> <b:TextBox ui:field="textPrivateLink" readOnly="true">
</b:TextBox> </b:TextBox>
</b:InputAddOn> </b:InputAddOn>
@ -100,8 +103,8 @@
<g:VerticalPanel ui:field="filedEnableDisableSharing" <g:VerticalPanel ui:field="filedEnableDisableSharing"
addStyleNames="{style.margin-bottom-20}"> addStyleNames="{style.margin-bottom-20}">
<g:HorizontalPanel> <g:HorizontalPanel>
<b:Label type="INFO" addStyleNames="{style.font-size-14}">Link Sharing with <b:Label type="INFO" addStyleNames="{style.font-size-14}">Link shareable with
Everyone</b:Label> everyone</b:Label>
<citem:SwitchButton ui:field="switchButton" <citem:SwitchButton ui:field="switchButton"
addStyleNames="{style.padding-left-10}"></citem:SwitchButton> addStyleNames="{style.padding-left-10}"></citem:SwitchButton>
</g:HorizontalPanel> </g:HorizontalPanel>
@ -113,7 +116,7 @@
<b:Fieldset ui:field="fieldSetPublic"> <b:Fieldset ui:field="fieldSetPublic">
<b:ControlGroup ui:field="cgPublicLink"> <b:ControlGroup ui:field="cgPublicLink" addStyleNames="my-control-group">
<b:Well ui:field="alertFolderPublicLink" visible="false">By sharing <b:Well ui:field="alertFolderPublicLink" visible="false">By sharing
the following Public the following Public
Link Link
@ -135,7 +138,8 @@
time of link creation</b:Well> time of link creation</b:Well>
<b:ControlLabel>Public Link</b:ControlLabel> <b:ControlLabel>Public Link</b:ControlLabel>
<b:Controls> <b:Controls>
<b:InputAddOn prependIcon="GLOBE"> <b:InputAddOn prependIcon="GLOBE"
addStyleNames="my-prepend-width">
<b:TextBox ui:field="textPublicLink" readOnly="true"> <b:TextBox ui:field="textPublicLink" readOnly="true">
</b:TextBox> </b:TextBox>
</b:InputAddOn> </b:InputAddOn>

View File

@ -1,10 +1,10 @@
@CHARSET "UTF-8"; @CHARSET "UTF-8";
.gwt-DialogBoxNew{ .gwt-DialogBoxNew {
border: 8px solid #99C0E8; border: 8px solid #99C0E8;
border-radius: 6px 6px 6px 6px; border-radius: 6px 6px 6px 6px;
box-shadow: none; box-shadow: none;
/* line-height: 7px; */ /* line-height: 7px; */
opacity: 1; opacity: 1;
z-index: 1500; z-index: 1500;
background-color: #FFFFFF; background-color: #FFFFFF;
@ -253,7 +253,7 @@ table.userssuggest th {
cursor: pointer; cursor: pointer;
} }
.disabledDIV{ .disabledDIV {
pointer-events: none; pointer-events: none;
opacity: 0.5; opacity: 0.5;
} }
@ -272,3 +272,21 @@ table.userssuggest th {
.modal-top-custom { .modal-top-custom {
top: 2% !important; top: 2% !important;
} }
.my-control-group .controls{
margin-left: 70px;
}
.my-control-group .control-label {
width: 80px;
text-align: center;
padding-right: 10px;
}
.my-control-group .add-on{
width: 20px !important;
}
.my-control-group .gwt-TextBox {
width: 370px !important;
}

View File

@ -1705,7 +1705,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
if (shortenUrl) { if (shortenUrl) {
shortURL = getShortUrl(httpURL); shortURL = getShortUrl(httpURL);
shortURL = shortURL != null ? shortURL : "not available"; shortURL = shortURL != null ? shortURL : "";
} }
return new PublicLink(httpURL, shortURL); return new PublicLink(httpURL, shortURL);