|
|
|
@ -216,6 +216,8 @@ public abstract class CreateThreddsConfigurationView extends Composite {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
|
cg_catalogue_name.setType(ControlGroupType.NONE);
|
|
|
|
|
setError(false, "");
|
|
|
|
|
|
|
|
|
|
if (field_catalogue_name.getValue() == null || field_catalogue_name.getValue().isEmpty()) {
|
|
|
|
|
cg_catalogue_name.setType(ControlGroupType.ERROR);
|
|
|
|
@ -223,17 +225,7 @@ public abstract class CreateThreddsConfigurationView extends Composite {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(field_folder_name.getValue() == null || field_folder_name.getValue().isEmpty()){
|
|
|
|
|
cg_folder_name.setType(ControlGroupType.ERROR);
|
|
|
|
|
setError(true, "The Folder Name is required");
|
|
|
|
|
return;
|
|
|
|
|
}else if(field_folder_name.getValue().startsWith("/")){
|
|
|
|
|
cg_folder_name.setType(ControlGroupType.ERROR);
|
|
|
|
|
setError(true, "Folder Name must be a relative URL. It does not start with '/'");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addCatalogueNameForCurrentScope(field_catalogue_name.getValue(), field_folder_name.getValue());
|
|
|
|
|
addCatalogueNameForCurrentScope(field_catalogue_name.getValue());
|
|
|
|
|
fieldset_add_catalogue_bean.setVisible(false);
|
|
|
|
|
initFieldCatalogueName();
|
|
|
|
|
}
|
|
|
|
@ -279,7 +271,7 @@ public abstract class CreateThreddsConfigurationView extends Composite {
|
|
|
|
|
* @param catalogueName the catalogue name
|
|
|
|
|
* @param folderName the folder name. Can be a relative Path
|
|
|
|
|
*/
|
|
|
|
|
private void addCatalogueNameForCurrentScope(String catalogueName, String folderName) {
|
|
|
|
|
private void addCatalogueNameForCurrentScope(String catalogueName) {
|
|
|
|
|
|
|
|
|
|
List<ThCatalogueBean> listCtlgs = mapCatalogueNames.get(currentScope);
|
|
|
|
|
|
|
|
|
@ -287,7 +279,7 @@ public abstract class CreateThreddsConfigurationView extends Composite {
|
|
|
|
|
listCtlgs = new ArrayList<ThCatalogueBean>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
listCtlgs.add(new ThCatalogueBean(catalogueName, folderName, true));
|
|
|
|
|
listCtlgs.add(new ThCatalogueBean(catalogueName, null, true));
|
|
|
|
|
fillSelectableCatalogueNames(currentScope, listCtlgs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -344,29 +336,24 @@ public abstract class CreateThreddsConfigurationView extends Composite {
|
|
|
|
|
*/
|
|
|
|
|
protected boolean validateSubmit() {
|
|
|
|
|
cg_catalogue_name.setType(ControlGroupType.NONE);
|
|
|
|
|
cg_folder_name.setType(ControlGroupType.NONE);
|
|
|
|
|
//cg_remote_path.setType(ControlGroupType.NONE);
|
|
|
|
|
|
|
|
|
|
// if(field_catalogue_name.getValue()==null || field_catalogue_name.getValue().isEmpty()){
|
|
|
|
|
// cg_catalogue_name.setType(ControlGroupType.ERROR);
|
|
|
|
|
// setError(true, "Catalogue Name is required");
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
if(field_select_catalogue_name.getSelectedItemText()==null){
|
|
|
|
|
cg_catalogue_name.setType(ControlGroupType.ERROR);
|
|
|
|
|
setError(true, "Select a Catalogue Name!!!");
|
|
|
|
|
setError(true, "You must select a Catalogue!!!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if(field_remote_path.getValue()==null || field_remote_path.getValue().isEmpty()){
|
|
|
|
|
// cg_remote_path.setType(ControlGroupType.ERROR);
|
|
|
|
|
// setError(true, "Remote Path field is required");
|
|
|
|
|
// return false;
|
|
|
|
|
// }else if(field_remote_path.getValue().startsWith("/")){
|
|
|
|
|
// cg_remote_path.setType(ControlGroupType.ERROR);
|
|
|
|
|
// setError(true, "Remote Path must be a relative URL. It does not start with '/'");
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
if(field_folder_name.getValue() == null || field_folder_name.getValue().isEmpty()){
|
|
|
|
|
cg_folder_name.setType(ControlGroupType.ERROR);
|
|
|
|
|
setError(true, "The Catalogue Entry is required");
|
|
|
|
|
return false;
|
|
|
|
|
}else if(field_folder_name.getValue().startsWith("/")){
|
|
|
|
|
cg_folder_name.setType(ControlGroupType.ERROR);
|
|
|
|
|
setError(true, "The Catalogue Entry must be a relative URL. It does not start with '/'");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -391,6 +378,16 @@ public abstract class CreateThreddsConfigurationView extends Composite {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the folder name.
|
|
|
|
|
*
|
|
|
|
|
* @return the folder name
|
|
|
|
|
*/
|
|
|
|
|
public String getFolderName(){
|
|
|
|
|
return field_folder_name.getValue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the catalogue name.
|
|
|
|
|
*
|
|
|
|
|