Commit 9efc6a71dbdd911a3df73382e4ffcdaf22b9461c

Authored by Fernando Ribeiro
1 parent 368dcbae4a
Exists in master

To prevent an empty list of sets, the Entire Repository will be added even no st…

…es are present in the resource. This will enable te validating the resource and not stop the process because of a null value.
.gitignore
... ... @@ -0,0 +1 @@
  1 +validador2-public.iml
... ...
src/pt/keep/metarepository/core/validator2/resources/RegistrationResource.java
... ... @@ -190,6 +190,13 @@ public class RegistrationResource {
190 190 private List<Pair<String, String>> getSetList(
191 191 ValidationRequestInfo validationRequest, String lang) {
192 192 List<Pair<String, String>> orderedSets = new ArrayList<Pair<String, String>>();
  193 + orderedSets
  194 + .add(new Pair<String, String>(
  195 + LocalizationManager
  196 + .getMessage(
  197 + "webui.validator.step2.form.options.set.all_repository",
  198 + lang), "##ALL_REPO##"));
  199 +
193 200 try {
194 201 Harvester harvester = new Harvester(validationRequest.getOai());
195 202 List<Set> listSets = harvester.listSets();
... ... @@ -200,12 +207,6 @@ public class RegistrationResource {
200 207 setsNames.add(set.getSetName());
201 208 }
202 209 Collections.sort(setsNames);
203   - orderedSets
204   - .add(new Pair<String, String>(
205   - LocalizationManager
206   - .getMessage(
207   - "webui.validator.step2.form.options.set.all_repository",
208   - lang), "##ALL_REPO##"));
209 210 for (String setName : setsNames) {
210 211 orderedSets.add(new Pair<String, String>(setName, sets
211 212 .get(setName)));
... ... @@ -216,6 +217,7 @@ public class RegistrationResource {
216 217 return orderedSets;
217 218 }
218 219  
  220 +
219 221 private int validateStep1Data(ValidationRequestInfo validationRequest) {
220 222 int res = 0;
221 223 if ("".equals(validationRequest.getResource())
... ...