css fix and added an alert block when publishing from the workspace and no file within the folder is available
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@130115 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
2cddc91288
commit
9c23a597aa
|
@ -20,7 +20,6 @@
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry excluding="**" kind="src" output="${webappDirectory}/WEB-INF/classes" path="src/main/resources">
|
<classpathentry excluding="**" kind="src" output="${webappDirectory}/WEB-INF/classes" path="src/main/resources">
|
||||||
|
|
|
@ -91,6 +91,7 @@ public class CreateDatasetForm extends Composite{
|
||||||
@UiField Button createButton;
|
@UiField Button createButton;
|
||||||
@UiField Button resetButton;
|
@UiField Button resetButton;
|
||||||
@UiField AlertBlock infoBlock;
|
@UiField AlertBlock infoBlock;
|
||||||
|
@UiField AlertBlock alertNoResources;
|
||||||
@UiField AlertBlock onContinueAlertBlock;
|
@UiField AlertBlock onContinueAlertBlock;
|
||||||
@UiField AlertBlock onCreateAlertBlock;
|
@UiField AlertBlock onCreateAlertBlock;
|
||||||
@UiField VerticalPanel metadataFieldsPanel;
|
@UiField VerticalPanel metadataFieldsPanel;
|
||||||
|
@ -326,15 +327,16 @@ public class CreateDatasetForm extends Composite{
|
||||||
resourcesControlGroup.setVisible(true);
|
resourcesControlGroup.setVisible(true);
|
||||||
addResourcesCheckBox.getElement().getStyle().setDisplay(Display.INLINE_BLOCK);
|
addResourcesCheckBox.getElement().getStyle().setDisplay(Display.INLINE_BLOCK);
|
||||||
resourcesTable = new ResourcesTable(bean.getResources());
|
resourcesTable = new ResourcesTable(bean.getResources());
|
||||||
|
|
||||||
|
|
||||||
// if there are not resources, for now just checked it ( and hide so that the step will be skipped) TODO
|
// if there are not resources, for now just checked it ( and hide so that the step will be skipped) TODO
|
||||||
if(bean.getResources() == null || bean.getResources().isEmpty()){
|
// if(bean.getResources() == null || bean.getResources().isEmpty()){
|
||||||
|
|
||||||
resourcesControlGroup.setVisible(false);
|
resourcesControlGroup.setVisible(false);
|
||||||
|
alertNoResources.setType(AlertType.WARNING);
|
||||||
}
|
alertNoResources.setVisible(true);
|
||||||
|
// }
|
||||||
|
|
||||||
// try to retrieve the licenses
|
// try to retrieve the licenses
|
||||||
setAlertBlock("Retrieving licenses, please wait...", AlertType.INFO, true);
|
setAlertBlock("Retrieving licenses, please wait...", AlertType.INFO, true);
|
||||||
ckanServices.getLicenses(new AsyncCallback<LicensesBean>() {
|
ckanServices.getLicenses(new AsyncCallback<LicensesBean>() {
|
||||||
|
@ -358,7 +360,7 @@ public class CreateDatasetForm extends Composite{
|
||||||
licenseListbox.setItemSelected(i, true);
|
licenseListbox.setItemSelected(i, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// everything went ok
|
// everything went ok
|
||||||
setAlertBlock("", AlertType.ERROR, false);
|
setAlertBlock("", AlertType.ERROR, false);
|
||||||
continueButton.setEnabled(true);
|
continueButton.setEnabled(true);
|
||||||
|
@ -827,6 +829,13 @@ public class CreateDatasetForm extends Composite{
|
||||||
return errorMessage;
|
return errorMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if version is a number
|
||||||
|
try{
|
||||||
|
Integer.valueOf(versionTextbox.getText());
|
||||||
|
}catch(Exception e){
|
||||||
|
return errorMessage = "Version must be a natural number";
|
||||||
|
}
|
||||||
|
|
||||||
// check if metadata profile is different from none and its mandatory fields have been fulfilled
|
// check if metadata profile is different from none and its mandatory fields have been fulfilled
|
||||||
if(checkSelectedMetaDataProfile()){
|
if(checkSelectedMetaDataProfile()){
|
||||||
errorMessage = "You must select a metadata profile different frome none";
|
errorMessage = "You must select a metadata profile different frome none";
|
||||||
|
@ -911,7 +920,7 @@ public class CreateDatasetForm extends Composite{
|
||||||
field.freeze();
|
field.freeze();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// freeze table of resources
|
// freeze table of resources
|
||||||
if(resourcesTable != null)
|
if(resourcesTable != null)
|
||||||
resourcesTable.freezeTable();
|
resourcesTable.freezeTable();
|
||||||
|
|
|
@ -226,9 +226,15 @@
|
||||||
</b:Controls>
|
</b:Controls>
|
||||||
</b:ControlGroup>
|
</b:ControlGroup>
|
||||||
|
|
||||||
|
<!-- Alert block on continue -->
|
||||||
|
<b:AlertBlock animation="true" visible="false"
|
||||||
|
ui:field="alertNoResources"
|
||||||
|
text="Please note that the product you are going to publish wont't have resources.">
|
||||||
|
</b:AlertBlock>
|
||||||
|
|
||||||
<!-- Alert block on continue -->
|
<!-- Alert block on continue -->
|
||||||
<b:AlertBlock type="INFO" close="false" animation="true"
|
<b:AlertBlock type="INFO" close="false" animation="true"
|
||||||
visible="false" ui:field="onContinueAlertBlock" styleName="{style.block-alert-style}">
|
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" type="PRIMARY"
|
||||||
|
@ -307,8 +313,9 @@
|
||||||
|
|
||||||
<b:Button title="Create product" ui:field="createButton"
|
<b:Button title="Create product" ui:field="createButton"
|
||||||
type="PRIMARY" block="true">Create</b:Button>
|
type="PRIMARY" block="true">Create</b:Button>
|
||||||
|
|
||||||
<b:Button title="Go Back" ui:field="goBackButtonFirstOrSecondStep" block="true">Go
|
<b:Button title="Go Back" ui:field="goBackButtonFirstOrSecondStep"
|
||||||
|
block="true">Go
|
||||||
Back</b:Button>
|
Back</b:Button>
|
||||||
|
|
||||||
<b:Button title="Go to product" ui:field="goToDatasetButton"
|
<b:Button title="Go to product" ui:field="goToDatasetButton"
|
||||||
|
|
|
@ -678,7 +678,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
||||||
* @param username
|
* @param username
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<ResourceBeanWrapper> getWorkspaceResourcesInformation(
|
private List<ResourceBeanWrapper> getWorkspaceResourcesInformation(
|
||||||
List<String> resourceIds, Workspace ws, String username) {
|
List<String> resourceIds, Workspace ws, String username) {
|
||||||
|
|
||||||
List<ResourceBeanWrapper> toReturn = null;
|
List<ResourceBeanWrapper> toReturn = null;
|
||||||
|
@ -689,14 +689,16 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
||||||
|
|
||||||
for (String resourceId : resourceIds) {
|
for (String resourceId : resourceIds) {
|
||||||
|
|
||||||
|
logger.debug("RESOURCE ID IS " + resourceId);
|
||||||
|
|
||||||
ResourceBeanWrapper newResource = new ResourceBeanWrapper();
|
ResourceBeanWrapper newResource = new ResourceBeanWrapper();
|
||||||
FolderItem item = (FolderItem)ws.getItem(resourceId);
|
WorkspaceItem item = ws.getItem(resourceId);
|
||||||
newResource.setDescription(item.getDescription());
|
newResource.setDescription(item.getDescription());
|
||||||
newResource.setId(item.getId());
|
newResource.setId(item.getId());
|
||||||
newResource.setUrl(item.getPublicLink(true));
|
newResource.setUrl(item.getPublicLink(true));
|
||||||
newResource.setName(item.getName());
|
newResource.setName(item.getName());
|
||||||
newResource.setToBeAdded(true); // default is true
|
newResource.setToBeAdded(true); // default is true
|
||||||
newResource.setMimeType(item.getMimeType());
|
newResource.setMimeType(((FolderItem)item).getMimeType());
|
||||||
newResource.setOwner(username);
|
newResource.setOwner(username);
|
||||||
toReturn.add(newResource);
|
toReturn.add(newResource);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue