Improved style-sheets. Improved mapping ws bean to resource bean

This commit is contained in:
Francesco Mangiacrapa 2021-03-22 12:12:07 +01:00
parent b8b94a58e4
commit af2b4e342a
3 changed files with 121 additions and 76 deletions

View File

@ -1,6 +1,7 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui" xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"
xmlns:m="urn:import:org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.tags"> xmlns:m="urn:import:org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.tags">
<ui:style> <ui:style>
.form-main-style { .form-main-style {
@ -45,7 +46,7 @@
font-weight: bold; font-weight: bold;
} }
.the-margin-left{ .the-margin-left {
margin-left: 5px; margin-left: 5px;
} }
</ui:style> </ui:style>
@ -64,8 +65,9 @@
</b:Legend> </b:Legend>
<!-- Alert blocks for info/errors --> <!-- Alert blocks for info/errors -->
<b:AlertBlock type="INFO" close="false" animation="true" <b:AlertBlock type="INFO" close="false"
visible="false" ui:field="infoBlock" styleName="{style.block-alert-style}"></b:AlertBlock> animation="true" visible="false" ui:field="infoBlock"
styleName="{style.block-alert-style}"></b:AlertBlock>
<b:ControlGroup ui:field="productTitleGroup"> <b:ControlGroup ui:field="productTitleGroup">
<b:ControlLabel for="title" title="Item title"> <b:ControlLabel for="title" title="Item title">
@ -73,13 +75,15 @@
Title : Title :
</b:ControlLabel> </b:ControlLabel>
<b:Controls> <b:Controls>
<b:TextBox alternateSize="LARGE" placeholder="Item title" <b:TextBox alternateSize="LARGE"
width="90%" b:id="title" title="Item title" ui:field="titleTextBox" /> placeholder="Item title" width="90%" b:id="title"
title="Item title" ui:field="titleTextBox" />
<span style="float:right; width:5%; color: #aaaaaa;"> <span style="float:right; width:5%; color: #aaaaaa;">
<b:Popover ui:field="popoverTitle" html="true" <b:Popover ui:field="popoverTitle" html="true"
animation="true" placement="LEFT"> animation="true" placement="LEFT">
<g:FocusPanel ui:field="focusPanelTitle"> <g:FocusPanel ui:field="focusPanelTitle">
<b:Icon type="INFO_SIGN" size="TWO_TIMES" ui:field="infoIconTitle" /> <b:Icon type="INFO_SIGN" size="TWO_TIMES"
ui:field="infoIconTitle" />
</g:FocusPanel> </g:FocusPanel>
</b:Popover> </b:Popover>
</span> </span>
@ -87,18 +91,21 @@
</b:ControlGroup> </b:ControlGroup>
<b:ControlGroup> <b:ControlGroup>
<b:ControlLabel for="description" title="Item description"> <b:ControlLabel for="description"
title="Item description">
Description: Description:
</b:ControlLabel> </b:ControlLabel>
<b:Controls> <b:Controls>
<b:TextArea placeholder="eg. Some useful notes about the item" <b:TextArea
width="90%" alternateSize="LARGE" b:id="description" title="Item description" placeholder="eg. Some useful notes about the item" width="90%"
alternateSize="LARGE" b:id="description" title="Item description"
ui:field="descriptionTextarea"></b:TextArea> ui:field="descriptionTextarea"></b:TextArea>
<span style="float:right; width:5%; color: #aaaaaa;"> <span style="float:right; width:5%; color: #aaaaaa;">
<b:Popover ui:field="popoverDescription" html="true" <b:Popover ui:field="popoverDescription" html="true"
animation="true" placement="LEFT"> animation="true" placement="LEFT">
<g:FocusPanel ui:field="focusPanelDescription"> <g:FocusPanel ui:field="focusPanelDescription">
<b:Icon type="INFO_SIGN" size="TWO_TIMES" ui:field="infoIconDescription" /> <b:Icon type="INFO_SIGN" size="TWO_TIMES"
ui:field="infoIconDescription" />
</g:FocusPanel> </g:FocusPanel>
</b:Popover> </b:Popover>
</span> </span>
@ -118,7 +125,8 @@
<b:Popover ui:field="popoverLicenses" html="true" <b:Popover ui:field="popoverLicenses" html="true"
animation="true" placement="LEFT"> animation="true" placement="LEFT">
<g:FocusPanel ui:field="focusPanelLicenses"> <g:FocusPanel ui:field="focusPanelLicenses">
<b:Icon type="INFO_SIGN" size="TWO_TIMES" ui:field="infoIconLicenses" /> <b:Icon type="INFO_SIGN" size="TWO_TIMES"
ui:field="infoIconLicenses" />
</g:FocusPanel> </g:FocusPanel>
</b:Popover> </b:Popover>
</span> </span>
@ -126,7 +134,8 @@
</b:ControlGroup> </b:ControlGroup>
<b:ControlGroup> <b:ControlGroup>
<b:ControlLabel for="licenseUrl" title="Selected License'url">Selected <b:ControlLabel for="licenseUrl"
title="Selected License'url">Selected
License Url:</b:ControlLabel> License Url:</b:ControlLabel>
<b:Controls> <b:Controls>
<b:Paragraph ui:field="unavailableUrl" visible="true"> <b:Paragraph ui:field="unavailableUrl" visible="true">
@ -138,7 +147,8 @@
</b:ControlGroup> </b:ControlGroup>
<b:ControlGroup> <b:ControlGroup>
<b:ControlLabel for="visibility" title="Visibility of the item">Visibility:</b:ControlLabel> <b:ControlLabel for="visibility"
title="Visibility of the item">Visibility:</b:ControlLabel>
<b:Controls> <b:Controls>
<b:ListBox b:id="visibility" title="Item visibility" <b:ListBox b:id="visibility" title="Item visibility"
width="91%" ui:field="visibilityListbox"> width="91%" ui:field="visibilityListbox">
@ -149,7 +159,8 @@
<b:Popover ui:field="popoverVisibility" html="true" <b:Popover ui:field="popoverVisibility" html="true"
animation="true" placement="LEFT"> animation="true" placement="LEFT">
<g:FocusPanel ui:field="focusPanelVisibility"> <g:FocusPanel ui:field="focusPanelVisibility">
<b:Icon type="INFO_SIGN" size="TWO_TIMES" ui:field="infoIconVisibility" /> <b:Icon type="INFO_SIGN" size="TWO_TIMES"
ui:field="infoIconVisibility" />
</g:FocusPanel> </g:FocusPanel>
</b:Popover> </b:Popover>
</span> </span>
@ -162,7 +173,8 @@
to publish the item">Publish in:</b:ControlLabel> to publish the item">Publish in:</b:ControlLabel>
<b:Controls> <b:Controls>
<b:ListBox b:id="organization" alternateSize="LARGE" <b:ListBox b:id="organization" alternateSize="LARGE"
width="91%" title="Publish in this organization" ui:field="organizationsListbox"> width="91%" title="Publish in this organization"
ui:field="organizationsListbox">
</b:ListBox> </b:ListBox>
</b:Controls> </b:Controls>
</b:ControlGroup> </b:ControlGroup>
@ -173,8 +185,9 @@
Version: Version:
</b:ControlLabel> </b:ControlLabel>
<b:Controls> <b:Controls>
<b:TextBox alternateSize="LARGE" placeholder="1.0" b:id="version" <b:TextBox alternateSize="LARGE" placeholder="1.0"
width="90%" title="Item version" ui:field="versionTextbox" /> b:id="version" width="90%" title="Item version"
ui:field="versionTextbox" />
</b:Controls> </b:Controls>
</b:ControlGroup> </b:ControlGroup>
@ -185,13 +198,14 @@
</b:ControlLabel> </b:ControlLabel>
<b:Controls> <b:Controls>
<b:TextBox alternateSize="LARGE" width="90%" <b:TextBox alternateSize="LARGE" width="90%"
placeholder="Joe Bloggs" enabled="false" b:id="author" title="Item author" placeholder="Joe Bloggs" enabled="false" b:id="author"
ui:field="authorTextbox" /> title="Item author" ui:field="authorTextbox" />
<span style="float:right; width:5%; color: #aaaaaa;"> <span style="float:right; width:5%; color: #aaaaaa;">
<b:Popover ui:field="popoverAuthor" html="true" <b:Popover ui:field="popoverAuthor" html="true"
animation="true" placement="LEFT"> animation="true" placement="LEFT">
<g:FocusPanel ui:field="focusPanelAuthor"> <g:FocusPanel ui:field="focusPanelAuthor">
<b:Icon type="INFO_SIGN" size="TWO_TIMES" ui:field="infoIconAuthor" /> <b:Icon type="INFO_SIGN" size="TWO_TIMES"
ui:field="infoIconAuthor" />
</g:FocusPanel> </g:FocusPanel>
</b:Popover> </b:Popover>
</span> </span>
@ -199,7 +213,8 @@
</b:ControlGroup> </b:ControlGroup>
<b:ControlGroup ui:field="authorEmailControlGroup"> <b:ControlGroup ui:field="authorEmailControlGroup">
<b:ControlLabel for="email" title="Item author's email"> <b:ControlLabel for="email"
title="Item author's email">
<font color="red">*</font> <font color="red">*</font>
Author Email: Author Email:
</b:ControlLabel> </b:ControlLabel>
@ -211,7 +226,8 @@
<b:Popover ui:field="popoverAuthorEmail" html="true" <b:Popover ui:field="popoverAuthorEmail" html="true"
animation="true" placement="LEFT"> animation="true" placement="LEFT">
<g:FocusPanel ui:field="focusPanelAuthorEmail"> <g:FocusPanel ui:field="focusPanelAuthorEmail">
<b:Icon type="INFO_SIGN" size="TWO_TIMES" ui:field="infoIconAuthorEmail" /> <b:Icon type="INFO_SIGN" size="TWO_TIMES"
ui:field="infoIconAuthorEmail" />
</g:FocusPanel> </g:FocusPanel>
</b:Popover> </b:Popover>
</span> </span>
@ -219,18 +235,20 @@
</b:ControlGroup> </b:ControlGroup>
<b:ControlGroup> <b:ControlGroup>
<b:ControlLabel for="maintainer" title="Item maintainer"> <b:ControlLabel for="maintainer"
title="Item maintainer">
Maintainer: Maintainer:
</b:ControlLabel> </b:ControlLabel>
<b:Controls> <b:Controls>
<b:TextBox alternateSize="LARGE" placeholder="Joe Bloggs" <b:TextBox alternateSize="LARGE"
width="90%" b:id="maintainer" title="Item maintainer" placeholder="Joe Bloggs" width="90%" b:id="maintainer"
ui:field="maintainerTextbox" /> title="Item maintainer" ui:field="maintainerTextbox" />
<span style="float:right; width:5%; color: #aaaaaa;"> <span style="float:right; width:5%; color: #aaaaaa;">
<b:Popover ui:field="popoverMaintainer" html="true" <b:Popover ui:field="popoverMaintainer" html="true"
animation="true" placement="LEFT"> animation="true" placement="LEFT">
<g:FocusPanel ui:field="focusPanelMaintainer"> <g:FocusPanel ui:field="focusPanelMaintainer">
<b:Icon type="INFO_SIGN" size="TWO_TIMES" ui:field="infoIconMaintainer" /> <b:Icon type="INFO_SIGN" size="TWO_TIMES"
ui:field="infoIconMaintainer" />
</g:FocusPanel> </g:FocusPanel>
</b:Popover> </b:Popover>
</span> </span>
@ -238,18 +256,21 @@
</b:ControlGroup> </b:ControlGroup>
<b:ControlGroup ui:field="maintainerControlGroup"> <b:ControlGroup ui:field="maintainerControlGroup">
<b:ControlLabel for="emailMaintaner" title="Item author's email"> <b:ControlLabel for="emailMaintaner"
title="Item author's email">
Maintainer Email: Maintainer Email:
</b:ControlLabel> </b:ControlLabel>
<b:Controls> <b:Controls>
<b:TextBox alternateSize="LARGE" placeholder="maintainer@example.com" <b:TextBox alternateSize="LARGE"
width="90%" b:id="emailMaintaner" title="Item author" placeholder="maintainer@example.com" width="90%"
b:id="emailMaintaner" title="Item author"
ui:field="maintainerEmailTextbox" /> ui:field="maintainerEmailTextbox" />
<span style="float:right; width:5%; color: #aaaaaa;"> <span style="float:right; width:5%; color: #aaaaaa;">
<b:Popover ui:field="popoverMaintainerEmail" html="true" <b:Popover ui:field="popoverMaintainerEmail"
animation="true" placement="LEFT"> html="true" animation="true" placement="LEFT">
<g:FocusPanel ui:field="focusPanelMaintainerEmail"> <g:FocusPanel ui:field="focusPanelMaintainerEmail">
<b:Icon type="INFO_SIGN" size="TWO_TIMES" ui:field="infoIconMaintainerEmail" /> <b:Icon type="INFO_SIGN" size="TWO_TIMES"
ui:field="infoIconMaintainerEmail" />
</g:FocusPanel> </g:FocusPanel>
</b:Popover> </b:Popover>
</span> </span>
@ -257,7 +278,8 @@
</b:ControlGroup> </b:ControlGroup>
<b:ControlGroup ui:field="metadataTypesControlGroup"> <b:ControlGroup ui:field="metadataTypesControlGroup">
<b:ControlLabel for="metadataTypes" title="Item profile types">Types:</b:ControlLabel> <b:ControlLabel for="metadataTypes"
title="Item profile types">Types:</b:ControlLabel>
<b:Controls> <b:Controls>
<b:ListBox b:id="metadataTypes" alternateSize="LARGE" <b:ListBox b:id="metadataTypes" alternateSize="LARGE"
width="91%" title="The item type to be used" width="91%" title="The item type to be used"
@ -268,7 +290,8 @@
<b:Popover ui:field="popoverTypes" html="true" <b:Popover ui:field="popoverTypes" html="true"
animation="true" placement="LEFT"> animation="true" placement="LEFT">
<g:FocusPanel ui:field="focusPanelTypes"> <g:FocusPanel ui:field="focusPanelTypes">
<b:Icon type="INFO_SIGN" size="TWO_TIMES" ui:field="infoIconTypes" /> <b:Icon type="INFO_SIGN" size="TWO_TIMES"
ui:field="infoIconTypes" />
</g:FocusPanel> </g:FocusPanel>
</b:Popover> </b:Popover>
</span> </span>
@ -277,10 +300,11 @@
<b:ControlGroup ui:field="groupsControlGroup" <b:ControlGroup ui:field="groupsControlGroup"
visible="false"> visible="false">
<b:ControlLabel for="groups" title="The groups for this item">Item Groups:</b:ControlLabel> <b:ControlLabel for="groups"
title="The groups for this item">Item Groups:</b:ControlLabel>
<b:Controls> <b:Controls>
<b:ListBox b:id="groups" alternateSize="LARGE" width="91%" <b:ListBox b:id="groups" alternateSize="LARGE"
multipleSelect="true" width="91%" multipleSelect="true"
title="The groups for this item (Hold CTRL or Command button for multiple selection)" title="The groups for this item (Hold CTRL or Command button for multiple selection)"
ui:field="groupsListbox"> ui:field="groupsListbox">
</b:ListBox> </b:ListBox>
@ -288,7 +312,8 @@
<b:Popover ui:field="popoverGroups" html="true" <b:Popover ui:field="popoverGroups" html="true"
animation="true" placement="LEFT"> animation="true" placement="LEFT">
<g:FocusPanel ui:field="focusPanelGroups"> <g:FocusPanel ui:field="focusPanelGroups">
<b:Icon type="INFO_SIGN" size="TWO_TIMES" ui:field="infoIconGroups" /> <b:Icon type="INFO_SIGN" size="TWO_TIMES"
ui:field="infoIconGroups" />
</g:FocusPanel> </g:FocusPanel>
</b:Popover> </b:Popover>
</span> </span>
@ -302,12 +327,12 @@
</b:AlertBlock> </b:AlertBlock>
<!-- Alert block on continue --> <!-- Alert block on continue -->
<b:AlertBlock type="INFO" close="false" animation="true" <b:AlertBlock type="INFO" close="false"
visible="false" ui:field="onContinueAlertBlock"> animation="true" visible="false" ui:field="onContinueAlertBlock">
</b:AlertBlock> </b:AlertBlock>
<b:Button title="Continue" ui:field="continueButton" type="PRIMARY" <b:Button title="Continue" ui:field="continueButton"
block="true">Continue</b:Button> type="PRIMARY" block="true">Continue</b:Button>
<b:Button title="Reset" ui:field="resetButton" block="true">Reset</b:Button> <b:Button title="Reset" ui:field="resetButton" block="true">Reset</b:Button>
</b:Fieldset> </b:Fieldset>
@ -318,18 +343,20 @@
ui:field="formSecondStep" visible="false"> ui:field="formSecondStep" visible="false">
<b:Fieldset styleName="{style.fieldset-border-style}"> <b:Fieldset styleName="{style.fieldset-border-style}">
<b:Legend styleName="{style.legend-style}"> <b:Legend styleName="{style.legend-style}">
Manage Resources Select Item Resources
</b:Legend> </b:Legend>
<b:ControlGroup> <b:ControlGroup>
<span style="float:right; width:5%; color: #aaaaaa;"> <span style="float:right; width:5%; color: #aaaaaa;">
<b:Popover ui:field="popoverResources" html="true" <b:Popover ui:field="popoverResources" html="true"
animation="true" placement="LEFT"> animation="true" placement="LEFT">
<g:FocusPanel ui:field="focusPanelResources"> <g:FocusPanel ui:field="focusPanelResources">
<b:Icon type="INFO_SIGN" size="TWO_TIMES" ui:field="infoIconResources" /> <b:Icon type="INFO_SIGN" size="TWO_TIMES"
</g:FocusPanel> ui:field="infoIconResources" />
</b:Popover> </g:FocusPanel>
</span> </b:Popover>
<g:SimplePanel ui:field="workspaceResourcesContainer" width="100%" visible="true"></g:SimplePanel> </span>
<g:SimplePanel ui:field="workspaceResourcesContainer"
width="100%" visible="true"></g:SimplePanel>
</b:ControlGroup> </b:ControlGroup>
<b:Button title="Continue" ui:field="continueThirdStep" <b:Button title="Continue" ui:field="continueThirdStep"
@ -353,7 +380,8 @@
</small> </small>
</b:Legend> </b:Legend>
<b:Paragraph ui:field="selectedProfile" styleName="{style.selected-profile}"></b:Paragraph> <b:Paragraph ui:field="selectedProfile"
styleName="{style.selected-profile}"></b:Paragraph>
<!-- Here will be placed the metadata fields formats --> <!-- Here will be placed the metadata fields formats -->
<g:VerticalPanel ui:field="metadataFieldsPanel" <g:VerticalPanel ui:field="metadataFieldsPanel"
@ -370,7 +398,8 @@
<b:Popover ui:field="popoverCustomFields" html="true" <b:Popover ui:field="popoverCustomFields" html="true"
animation="true" placement="LEFT"> animation="true" placement="LEFT">
<g:FocusPanel ui:field="focusPanelCustomFields"> <g:FocusPanel ui:field="focusPanelCustomFields">
<b:Icon type="INFO_SIGN" size="TWO_TIMES" ui:field="infoIconCustomFields" /> <b:Icon type="INFO_SIGN" size="TWO_TIMES"
ui:field="infoIconCustomFields" />
</g:FocusPanel> </g:FocusPanel>
</b:Popover> </b:Popover>
</span> </span>
@ -380,18 +409,22 @@
</b:ControlGroup> </b:ControlGroup>
<!-- Alert block on create --> <!-- Alert block on create -->
<b:AlertBlock type="INFO" close="false" animation="true" <b:AlertBlock type="INFO" close="false"
visible="false" ui:field="onCreateAlertBlock" styleName="{style.block-alert-style}"> animation="true" visible="false" ui:field="onCreateAlertBlock"
styleName="{style.block-alert-style}">
</b:AlertBlock> </b:AlertBlock>
<g:HorizontalPanel ui:field="goToDatasetButtonPanel" visible="false"> <g:HorizontalPanel
ui:field="goToDatasetButtonPanel" visible="false">
<g:Label>Go to the Item</g:Label> <g:Label>Go to the Item</g:Label>
<b:Button title="Go to the Item" ui:field="goToDatasetButton" <b:Button title="Go to the Item"
type="LINK" visible="false" styleName="{style.the-margin-left}"></b:Button> ui:field="goToDatasetButton" type="LINK" visible="false"
styleName="{style.the-margin-left}"></b:Button>
</g:HorizontalPanel> </g:HorizontalPanel>
<b:Button title="Add resources to the just created item" <b:Button title="Add resources to the just created item"
block="true" type="PRIMARY" visible="false" ui:field="addResourcesButton">Add Resources</b:Button> block="true" type="PRIMARY" visible="false"
ui:field="addResourcesButton">Add Resources</b:Button>
<b:Button title="Create Item" ui:field="createButton" <b:Button title="Create Item" ui:field="createButton"
type="PRIMARY" block="true">Create</b:Button> type="PRIMARY" block="true">Create</b:Button>

View File

@ -8,11 +8,9 @@
} }
.custom-header { .custom-header {
margin-top: 0px !important; margin: 0;
}
.custom-header h1 {
font-size: 18px !important; font-size: 18px !important;
color: #222;
} }
.max-height-250 { .max-height-250 {
@ -24,14 +22,14 @@
margin-top: 10px; margin-top: 10px;
} }
.margin-top-20 { .margin-top-30 {
margin-top: 20px; margin-top: 30px;
} }
</ui:style> </ui:style>
<g:HTMLPanel width="96%"> <g:HTMLPanel width="96%">
<g:HTMLPanel> <g:HTMLPanel>
<b:PageHeader addStyleNames="{style.custom-header}">Select Item Resources</b:PageHeader> <b:Heading size="1" addStyleNames="{style.custom-header}">Selected Items</b:Heading>
<b:Alert ui:field="showAlert" visible="false"></b:Alert> <b:Alert ui:field="showAlert" visible="false"></b:Alert>
<g:FlowPanel ui:field="selectResourcesContainer" <g:FlowPanel ui:field="selectResourcesContainer"
width="100%"> width="100%">
@ -40,7 +38,7 @@
</g:HTMLPanel> </g:HTMLPanel>
<g:HTMLPanel ui:field="containerPickResources" <g:HTMLPanel ui:field="containerPickResources"
addStyleNames="{style.margin-top-20}"> addStyleNames="{style.margin-top-30}">
<b:AccordionGroup ui:field="buttPickResources" <b:AccordionGroup ui:field="buttPickResources"
heading="Add files from..." defaultOpen="false" heading="Add files from..." defaultOpen="false"
addStyleNames="accordion-no-border-inner"> addStyleNames="accordion-no-border-inner">

View File

@ -111,7 +111,6 @@ public class WorkspaceUtils {
public static void toWorkspaceResource(String wsItemId, String userName, public static void toWorkspaceResource(String wsItemId, String userName,
DatasetBean bean, Workspace workspace) throws Exception { DatasetBean bean, Workspace workspace) throws Exception {
WorkspaceItem originalFolderOrFile = workspace.getItem(wsItemId); WorkspaceItem originalFolderOrFile = workspace.getItem(wsItemId);
logger.debug("Item retrieved is " + originalFolderOrFile); logger.debug("Item retrieved is " + originalFolderOrFile);
@ -149,14 +148,29 @@ public class WorkspaceUtils {
bean.setCustomFields(tempItems); bean.setCustomFields(tempItems);
} }
String pathSeparator = "/";
String fullPathBase = originalFolderOrFile.getPath();
fullPathBase = fullPathBase.endsWith(pathSeparator) ? fullPathBase : fullPathBase + pathSeparator;
resourceEB.setFullPath(originalFolderOrFile.getPath().replace(fullPathBase, ""));
resourceEB.setChildrenSize(workspace.getChildren(originalFolderOrFile.getId()).size()); resourceEB.setChildrenSize(workspace.getChildren(originalFolderOrFile.getId()).size());
//WorkspaceUtils.extractEditableNameFromPath(resourceEB, pathSeparator); }else {
//it is a file, removing extension
int indexOfDot = title.lastIndexOf(".");
String suffix = title.substring(indexOfDot, title.length());
if(suffix.length()>=1 && suffix.length()<=4) {
//I'm considering last .suffix as an file extension so removing it.
title = title.substring(0,indexOfDot);
bean.setTitle(title);
}
} }
//Replacing /Home/user.name with ""
String fullPathBase = originalFolderOrFile.getPath();
logger.debug("Path is: "+fullPathBase);
String prefixNodeWorkspace = String.format("/%s/%s", "Home",userName);
logger.debug("Searching: "+prefixNodeWorkspace);
if(fullPathBase.startsWith(prefixNodeWorkspace)){
logger.info("Removing from path the prefix: "+prefixNodeWorkspace);
fullPathBase = fullPathBase.replaceFirst(prefixNodeWorkspace, "");
}
resourceEB.setFullPath(fullPathBase);
//setting parent id //setting parent id
ResourceElementBean theParent = new ResourceElementBean(); ResourceElementBean theParent = new ResourceElementBean();