Applied the changes requested at https://support.d4science.org/issues/17552#note-11
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:
parent
97c16c7e13
commit
82eb3458cb
|
@ -116,7 +116,7 @@ public class DialogShareableLink extends Composite {
|
|||
private boolean itemIsPublicStatus;
|
||||
|
||||
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";
|
||||
|
||||
|
||||
|
@ -201,6 +201,7 @@ public class DialogShareableLink extends Composite {
|
|||
alertFolderPublicLink.setVisible(false);
|
||||
filedEnableDisableSharing.setVisible(false);
|
||||
buttonShareSettings.setVisible(false);
|
||||
switchButton.setVisible(true);
|
||||
//panelFieldsContainer.setVisible(false);
|
||||
showMessage("", false);
|
||||
this.itemIsPublicStatus = item.isPublic();
|
||||
|
@ -237,6 +238,14 @@ public class DialogShareableLink extends Composite {
|
|||
|
||||
//THE FOLDER IS PRIVATE - NO SHARED AND NO PUBLIC
|
||||
if(!item.isPublic() && !item.isShared()) {
|
||||
|
||||
//SHARING WITH COWORKERS
|
||||
if(item.isShareable()) {
|
||||
fieldPrivateSharing.setVisible(true);
|
||||
buttonShareSettings.setVisible(true);
|
||||
}
|
||||
|
||||
//SHARING WITH EVERYONE
|
||||
filedEnableDisableSharing.setVisible(true);
|
||||
alertFolderPublicLink.setVisible(true);
|
||||
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
|
||||
//panelFieldsContainer.setVisible(true);
|
||||
cgPublicLink.setVisible(true);
|
||||
filedEnableDisableSharing.setVisible(true);
|
||||
alertFilePublicLink.setVisible(true);
|
||||
if(!item.isPublic()) { //THE FILE IS PRIVATE
|
||||
switchButton.setVisible(false);
|
||||
if(version!=null && !version.isEmpty()) {
|
||||
showPublicLinkForFileItemIdToVersion(item, textPublicLink, version);
|
||||
}else {
|
||||
|
@ -272,14 +283,33 @@ public class DialogShareableLink extends Composite {
|
|||
* @param item the item
|
||||
* @param toTextBox the to text box
|
||||
*/
|
||||
private void loadAndShowPrivateLink(FileModel item, TextBox toTextBox) {
|
||||
private void loadAndShowPrivateLink(FileModel item, final TextBox toTextBox) {
|
||||
|
||||
String currentUrl = portalURL();
|
||||
int lastChar = currentUrl.lastIndexOf("?");
|
||||
currentUrl = lastChar > -1 ? currentUrl.substring(0, lastChar) : currentUrl;
|
||||
String shareLinkUrl = currentUrl + "?" + ConstantsExplorer.GET_ITEMID_PARAMETER + "=" + item.getIdentifier();
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,10 +4,6 @@
|
|||
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"
|
||||
xmlns:citem="urn:import:org.gcube.portlets.widgets.switchbutton.client">
|
||||
<ui:style>
|
||||
.textbox-width {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.back-color-info {
|
||||
background-color: #fafaff !important;
|
||||
}
|
||||
|
@ -43,6 +39,11 @@
|
|||
vertical-align: top;
|
||||
padding-top: 0px !important;
|
||||
}
|
||||
|
||||
.no-border {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
</ui:style>
|
||||
<g:HTMLPanel>
|
||||
<b:Form type="HORIZONTAL">
|
||||
|
@ -54,41 +55,43 @@
|
|||
<g:VerticalPanel ui:field="fieldPrivateSharing"
|
||||
addStyleNames="{style.margin-bottom-20}">
|
||||
<g:HorizontalPanel>
|
||||
<b:Label type="INFO" addStyleNames="{style.font-size-14}">Link Sharing with
|
||||
Coworkers</b:Label>
|
||||
<b:Label type="INFO" addStyleNames="{style.font-size-14}">Link shareable with
|
||||
coworkers</b:Label>
|
||||
<citem:SwitchButton
|
||||
ui:field="switchButtonPrivate" addStyleNames="{style.not-active}"
|
||||
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:VerticalPanel
|
||||
addStyleNames="{style.margin-left-5}">
|
||||
<g:Label ui:field="labelLinkPrivateSharing">(Only the) Members belonging to the
|
||||
share
|
||||
can view</g:Label>
|
||||
<g:Label ui:field="labelLinkPrivateSharing">(Only the) Members of the group the
|
||||
folder is shared with are enacted to view</g:Label>
|
||||
</g:VerticalPanel>
|
||||
</g:VerticalPanel>
|
||||
|
||||
<b:Fieldset ui:field="fieldSetPrivate">
|
||||
<b:Fieldset ui:field="fieldSetPrivate"
|
||||
styleName="{style.noBorder}">
|
||||
<g:HTMLPanel>
|
||||
<!-- <b:Legend>sharing....</b:Legend> -->
|
||||
<b:ControlGroup ui:field="cgPrivateLink">
|
||||
<b:ControlGroup ui:field="cgPrivateLink"
|
||||
addStyleNames="my-control-group">
|
||||
|
||||
<b:Well ui:field="wellPrivateLinkDescription">
|
||||
By sharing the following Private Link
|
||||
to folder with
|
||||
to
|
||||
folder with
|
||||
your
|
||||
coworkers,
|
||||
you will
|
||||
enact users (only the members belonging to the
|
||||
shared
|
||||
folder),
|
||||
after login, to access
|
||||
the
|
||||
content</b:Well>
|
||||
you will enact the users of the group
|
||||
the folder is shared with,
|
||||
after login, to access the shared
|
||||
folder content</b:Well>
|
||||
<b:ControlLabel>Private Link</b:ControlLabel>
|
||||
<b:Controls>
|
||||
<b:InputAddOn prependIcon="LINK">
|
||||
<b:InputAddOn prependIcon="LINK"
|
||||
addStyleNames="my-prepend-width">
|
||||
<b:TextBox ui:field="textPrivateLink" readOnly="true">
|
||||
</b:TextBox>
|
||||
</b:InputAddOn>
|
||||
|
@ -100,8 +103,8 @@
|
|||
<g:VerticalPanel ui:field="filedEnableDisableSharing"
|
||||
addStyleNames="{style.margin-bottom-20}">
|
||||
<g:HorizontalPanel>
|
||||
<b:Label type="INFO" addStyleNames="{style.font-size-14}">Link Sharing with
|
||||
Everyone</b:Label>
|
||||
<b:Label type="INFO" addStyleNames="{style.font-size-14}">Link shareable with
|
||||
everyone</b:Label>
|
||||
<citem:SwitchButton ui:field="switchButton"
|
||||
addStyleNames="{style.padding-left-10}"></citem:SwitchButton>
|
||||
</g:HorizontalPanel>
|
||||
|
@ -113,7 +116,7 @@
|
|||
|
||||
|
||||
<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
|
||||
the following Public
|
||||
Link
|
||||
|
@ -135,7 +138,8 @@
|
|||
time of link creation</b:Well>
|
||||
<b:ControlLabel>Public Link</b:ControlLabel>
|
||||
<b:Controls>
|
||||
<b:InputAddOn prependIcon="GLOBE">
|
||||
<b:InputAddOn prependIcon="GLOBE"
|
||||
addStyleNames="my-prepend-width">
|
||||
<b:TextBox ui:field="textPublicLink" readOnly="true">
|
||||
</b:TextBox>
|
||||
</b:InputAddOn>
|
||||
|
|
|
@ -272,3 +272,21 @@ table.userssuggest th {
|
|||
.modal-top-custom {
|
||||
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;
|
||||
}
|
|
@ -1705,7 +1705,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
|||
|
||||
if (shortenUrl) {
|
||||
shortURL = getShortUrl(httpURL);
|
||||
shortURL = shortURL != null ? shortURL : "not available";
|
||||
shortURL = shortURL != null ? shortURL : "";
|
||||
}
|
||||
|
||||
return new PublicLink(httpURL, shortURL);
|
||||
|
|
Loading…
Reference in New Issue