Commit 1f7e89c7c458bed93a264cea09d283f9861ab3c0

Authored by Fernando Ribeiro

Merge branch 'fixCurationTasks' into 'DSpace52++'

Melhorias às tarefas de curadoria

Mudou a ordem, mensagem dos duplicados, mensagem de quando está tudo bem.
DOI foi corrigido.

See merge request !9
dspace-api/src/main/java/pt/uminho/sdum/dspace/curationtasks/CheckDuplicates.java
... ... @@ -34,7 +34,7 @@ public class CheckDuplicates extends AbstractCurationTask {
34 34 }
35 35 return 0;
36 36 } else {
37   - setResult("Task must be applied to Site");
  37 + setResult("A tarefa deve ser aplicada ao site inteiro");
38 38 return 2;
39 39 }
40 40 }
... ...
dspace-api/src/main/java/pt/uminho/sdum/dspace/curationtasks/Distributor.java
... ... @@ -14,25 +14,26 @@ import java.util.Set;
14 14 */
15 15 abstract class Distributor extends AbstractCurationTask {
16 16  
  17 + private static String def="Não foram encontrados quaisquer problemas";
  18 +
17 19 @Override
18 20 public int perform(DSpaceObject dso) throws IOException {
19 21 try {
20   -
  22 + String res;
21 23 if (dso instanceof Item) {
22   - setResult(processItem((Item) dso));
  24 + putResult(processItem((Item) dso));
23 25 return 0;
24 26  
25 27 } else if (dso instanceof Community) {
26   - setResult(processCommunity((Community) dso, new HashSet<Collection>()));
  28 + putResult(processCommunity((Community) dso, new HashSet<Collection>()));
27 29 return 0;
28 30  
29 31 } else if (dso instanceof Collection) {
30   -
31   - setResult(processCollection((Collection) dso, new HashSet<Collection>()));
  32 + putResult(processCollection((Collection) dso, new HashSet<Collection>()));
32 33 return 0;
33 34  
34 35 } else if (dso instanceof Site) {
35   - setResult(processSite());
  36 + putResult(processSite());
36 37 return 0;
37 38 } else {
38 39 setResult("Task must be applied to Collection or Community or Site");
... ... @@ -44,6 +45,12 @@ abstract class Distributor extends AbstractCurationTask {
44 45 return 1;
45 46 }
46 47  
  48 + private void putResult(String res){
  49 + if(res!=null && !res.equals(""))
  50 + setResult(res);
  51 + else
  52 + setResult(def);
  53 + }
47 54  
48 55 private String processSite() throws SQLException {
49 56 StringBuilder res = new StringBuilder();
... ...
dspace-api/src/main/java/pt/uminho/sdum/dspace/curationtasks/DoiValidator.java
... ... @@ -22,14 +22,14 @@ public class DoiValidator extends Distributor {
22 22  
23 23  
24 24 if (doi != null) {
25   - if (!doi.startsWith("http://dx.doi.org/")) {
  25 + /* if (!doi.startsWith("http://dx.doi.org/")) {
26 26 sb.append("<a href=\"http://hdl.handle.net/");
27 27 sb.append(handle);
28 28 sb.append("\" target=\"_blank\">");
29 29 sb.append(handle);
30 30 sb.append("</a> não tem o prefixo do DOI (http://dx.doi.org/) <br>");
31 31 //got regex from http://blog.crossref.org/2015/08/doi-regular-expressions.html
32   - } else {
  32 + } else { */
33 33 String sub = doi.substring(18);
34 34 if (!sub.matches("^10.\\d{4,9}/[-._;()/:a-zA-Z0-9]+$")) {
35 35 sb.append("<a href=\"http://hdl.handle.net/");
... ... @@ -38,7 +38,7 @@ public class DoiValidator extends Distributor {
38 38 sb.append(handle);
39 39 sb.append("</a> pode ter um DOI inválido <br>");
40 40 }
41   - }
  41 + //}
42 42 }
43 43  
44 44 return sb.toString();
... ...
dspace-jspui/src/main/resources/Messages.properties
... ... @@ -252,7 +252,7 @@ jsp.dspace-admin.confirm-delete-mdschema.warning = This will resu
252 252 jsp.dspace-admin.curate.main.title = Curation Tasks
253 253 jsp.dspace-admin.curate.main.heading = System Curation Tasks
254 254 jsp.dspace-admin.curate.main.info1 = Handle of DSpace Object
255   -jsp.dspace-admin.curate.main.info2 = Hint: Enter [your-handle-prefix]/0 to run a task across entire site (not all tasks may support this capability)
  255 +jsp.dspace-admin.curate.main.info2 = Hint: Enter [your-handle-prefix]/0 to run a task across entire site
256 256 jsp.dspace-admin.eperson-browse.canlogin = Can Log In?
257 257 jsp.dspace-admin.eperson-browse.email = E-mail Address
258 258 jsp.dspace-admin.eperson-browse.heading = Browse EPeople {0}-{1} of {2}
... ...
dspace-jspui/src/main/resources/Messages_pt_PT.properties
... ... @@ -263,7 +263,7 @@ jsp.dspace-admin.batchimport.errormsg = Mensagem de erro
263 263 jsp.dspace-admin.curate.main.title = Tarefas de Curadoria
264 264 jsp.dspace-admin.curate.main.heading = Sistema de Tarefas de Curadoria
265 265 jsp.dspace-admin.curate.main.info1 = Handle do Objecto Dspace
266   -jsp.dspace-admin.curate.main.info2 = Sugest&atilde;o: Introduzir [seu-handle-prefix]/0 para executar uma tarefa por todo o site (nem todas as tarefas suportar&atilde;o esta tarefa)
  266 +jsp.dspace-admin.curate.main.info2 = Sugest&atilde;o: Introduzir [seu-handle-prefix]/0 para executar uma tarefa por todo o site
267 267 jsp.tools.curate.collection.title = Curar Cole&ccedil;&atilde;o
268 268 jsp.tools.curate.collection.heading = Curar Cole&ccedil;&atilde;o: {0}
269 269 jsp.tools.curate.community.title = Curar Comunidade
... ...
dspace-jspui/src/main/webapp/dspace-admin/curate-main.jsp
... ... @@ -58,8 +58,8 @@
58 58  
59 59 <div class="input-group">
60 60 <label class="input-group-addon"><fmt:message key="jsp.dspace-admin.curate.main.info1"/>:</label>
61   - <input class="form-control" type="text" name="handle" value="<%= handle %>" size="20"/>
62 61 <span class="col-md-10"><fmt:message key="jsp.dspace-admin.curate.main.info2"/></span>
  62 + <input class="form-control" type="text" name="handle" value="<%= handle %>" size="20"/>
63 63 </div>
64 64  
65 65  
... ...
dspace/config/modules/curate.cfg
... ... @@ -32,13 +32,13 @@ taskqueue.dir = ${dspace.dir}/ctqueues
32 32 # Also acts as a filter - i.e. tasks not enumerated here can still
33 33 # be invoked on cmd line, etc - just not in UI
34 34 ui.tasknames = \
35   - profileformats = Profile Bitstream Formats, \
36   - requiredmetadata = Check for Required Metadata, \
37   - checklinks = Check Links in Metadata, \
38 35 checktid = Verificar TID em Teses/Dissertações após 7/8/2013, \
39 36 checkdup = Verificar Depositos Duplicados (pode demorar), \
  37 + checkembjust = Verificar Justificação de Embargo, \
40 38 checkdoi = Validar DOIs, \
41   - checkembjust = Verificar Justificação de Embargo
  39 + profileformats = Profile Bitstream Formats, \
  40 + requiredmetadata = Check for Required Metadata, \
  41 + checklinks = Check Links in Metadata
42 42  
43 43 # Tasks may be organized into named groups which display together in UI drop-downs
44 44 # ui.taskgroups = \
... ...