Added modification time to compilation generator
This commit is contained in:
parent
7d33caee8a
commit
bd3b2f31ea
2 changed files with 23 additions and 0 deletions
|
@ -2,13 +2,17 @@
|
|||
|
||||
package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
|
@ -148,6 +152,7 @@ public class CompilationGenerator extends BaseEditConfigurationGenerator impleme
|
|||
StringBuilder n3Req = new StringBuilder();
|
||||
n3Req.append("@prefix ts: <https://litvinovg.pro/text_structures#> .\n");
|
||||
n3Req.append("?newCompilation <" + VitroVocabulary.RDF_TYPE + "> <" + getTypeOfNew(vreq) + "> .\n");
|
||||
n3Req.append("?newCompilation <https://litvinovg.pro/text_structures#modificationTime> " + getModificationTime() + " .\n");
|
||||
n3Req.append("?newCompilation <" + RDFS.label.getURI() + "> ?newCompilationLabel .\n");
|
||||
n3Req.append("?newCompilation ts:hasTOC ?newCompilationTOC .\n");
|
||||
n3Req.append("?newCompilationTOC <" + VitroVocabulary.RDF_TYPE + "> ts:TOC .\n");
|
||||
|
@ -175,6 +180,15 @@ public class CompilationGenerator extends BaseEditConfigurationGenerator impleme
|
|||
}
|
||||
return list(n3Req.toString());
|
||||
}
|
||||
|
||||
private String getModificationTime() {
|
||||
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
|
||||
sd.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
Date currentTime = Calendar.getInstance().getTime();
|
||||
String todayAsString = "\"" + sd.format(currentTime) + "\"^^<http://www.w3.org/2001/XMLSchema#dateTime>";
|
||||
return todayAsString;
|
||||
}
|
||||
|
||||
private static Integer parseCounter(VitroRequest vreq) {
|
||||
String text = vreq.getParameter("excerptsCount");
|
||||
if (text == null ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue