Commit 2401cf50 authored by Gradl, Tobias's avatar Gradl, Tobias
parents 8feb80d9 6d8d9790
Pipeline #8637 passed with stages
in 8 minutes and 21 seconds

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.unibamberg.minf</groupId>
<artifactId>dme</artifactId>
<version>3.2.4-RELEASE</version>
<version>3.2.5-RELEASE</version>
<packaging>war</packaging>
<name>DARIAH-DE Data Modeling Environment</name>
<description>DARIAH-DE Data Modeling Environment</description>
......@@ -16,7 +16,7 @@
<de.unibamberg.minf.core-version>5.0.0-RELEASE</de.unibamberg.minf.core-version>
<de.unibamberg.minf.gtf-version>1.4.0-RELEASE</de.unibamberg.minf.gtf-version>
<eu.dariah.de.minfba.processing.version>3.5.0-RELEASE</eu.dariah.de.minfba.processing.version>
<eu.dariah.de.minfba.processing.version>3.5.1-RELEASE</eu.dariah.de.minfba.processing.version>
<eu.dariah.de.dariahsp-version>1.2.2-SNAPSHOT</eu.dariah.de.dariahsp-version>
......@@ -378,6 +378,36 @@
</distributionManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>compress</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnIncremental>false</runOnIncremental>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
......
......@@ -49,6 +49,11 @@ public class HomeController {
}
return "common/logout";
}
@RequestMapping(value = "/user", method = RequestMethod.GET)
public String getUser() throws IOException {
return "common/user";
}
@RequestMapping(value = "/login", method = RequestMethod.GET)
public String getLogin(@RequestParam(value = "error", required = false) String error, @RequestParam(value = "url", defaultValue = "/") String url, HttpServletRequest request, HttpServletResponse response, Model model) throws IOException {
......
......@@ -73,7 +73,7 @@ public class SchemaController extends BaseScheregController {
public String getAddForm(Model model, Locale locale) {
model.addAttribute("datamodelImpl", new DatamodelImpl());
model.addAttribute("actionPath", "/model/async/save");
return "schema/form/edit";
return "model/form/edit";
}
@PreAuthorize("isAuthenticated()")
......
......@@ -150,14 +150,18 @@ public class SessionsController {
response.setStatus(HttpServletResponse.SC_RESET_CONTENT);
return null;
}
List<LogEntry> log = session.getSortedSessionLog();
List<LogEntry> log = session.getSessionLog();
if (tsMin!=null && log.size()>0 && log.get(0).getTimestamp().getMillis()<=tsMin) {
return new ArrayList<LogEntryPojo>();
}
if (log.size() > maxEntries) {
return logEntryConverter.convert(log.subList(0, maxEntries), locale);
if (log!=null && log.size()>0) {
if (log.size() > maxEntries) {
return logEntryConverter.convert(log.subList(0, maxEntries), locale);
}
return logEntryConverter.convert(log, locale);
} else {
return new ArrayList<LogEntryPojo>();
}
return logEntryConverter.convert(log, locale);
}
}
......@@ -73,6 +73,7 @@ import de.unibamberg.minf.dme.service.interfaces.MappedConceptService;
import de.unibamberg.minf.dme.service.interfaces.MappingService;
import de.unibamberg.minf.dme.service.interfaces.PersistedSessionService;
import de.unibamberg.minf.processing.exception.ProcessingConfigException;
import de.unibamberg.minf.processing.model.SerializableResource;
import de.unibamberg.minf.processing.model.base.Resource;
import de.unibamberg.minf.processing.output.FileOutputService;
import de.unibamberg.minf.processing.output.json.JsonFileOutputService;
......@@ -133,6 +134,49 @@ public abstract class BaseMainEditorController extends BaseScheregController {
return result;
}
@RequestMapping(method=GET, value={"/incl/activity"})
public String getActivityIncl(@PathVariable String entityId, Model model, HttpServletRequest request) {
return "schemaEditor/incl/activity";
}
@RequestMapping(method=GET, value={"/incl/sample"})
public String getSampleIncl(@PathVariable String entityId, Model model, HttpServletRequest request) {
AuthPojo auth = authInfoHelper.getAuth(request);
boolean oversized = false;
try {
PersistedSession s = sessionService.accessOrCreate(entityId, request.getSession().getId(), auth.getUserId());
model.addAttribute("session", s);
model.addAttribute("sampleOutput", sessionService.loadSampleOutput(s.getId()));
/*if (s.getSampleInput()!=null) {
if (s.getSampleInput().getBytes().length>this.maxTravelSize) {*/
oversized = true;
/*} else {
model.addAttribute("sampleInput", s.getSampleInput());
}
}*/
} catch (Exception e) {
logger.error("Failed to load/initialize persisted session", e);
}
model.addAttribute("sampleInputOversize", oversized);
return "editor/incl/sample";
}
@RequestMapping(method=GET, value={"/incl/output"})
public String getOutputIncl(@PathVariable String entityId, Model model, HttpServletRequest request) {
return this.getResultIncl(entityId, "output", model, request);
}
@RequestMapping(method=GET, value={"/incl/mapped"})
public String getMappedIncl(@PathVariable String entityId, Model model, HttpServletRequest request) {
return this.getResultIncl(entityId, "mapped", model, request);
}
@RequestMapping(method=GET, value={"/forms/fileupload"})
public String getImportForm(Model model, Locale locale) {
return "common/fileupload";
......@@ -160,6 +204,22 @@ public abstract class BaseMainEditorController extends BaseScheregController {
return result;
}
private String getResultIncl(String entityId, String resultType, Model model, HttpServletRequest request) {
AuthPojo auth = authInfoHelper.getAuth(request);
try {
PersistedSession s = sessionService.accessOrCreate(entityId, request.getSession().getId(), auth.getUserId());
model.addAttribute("session", s);
} catch (Exception e) {
logger.error("Failed to load/initialize persisted session", e);
}
model.addAttribute("resultType", resultType);
return "editor/incl/output";
}
private JsonNode uploadFile(MultipartHttpServletRequest request, String validationUrl) throws IOException {
MultiValueMap<String, MultipartFile> multipartMap = request.getMultiFileMap();
CommonsMultipartFile file = null;
......@@ -291,7 +351,7 @@ public abstract class BaseMainEditorController extends BaseScheregController {
}
if (type.equals("output")) {
result.setPojo(objectMapper.convertValue(s.getSampleOutput(), JsonNode.class));
result.setPojo(objectMapper.convertValue(sessionService.loadSampleOutput(s.getId()), JsonNode.class));
} else if (type.equals("transformed")) {
} else {
......@@ -320,8 +380,9 @@ public abstract class BaseMainEditorController extends BaseScheregController {
throw new GenericScheregException("Session not available. Try to re-login.");
}
if (s.getSampleOutput()!=null && s.getSampleOutput().size()>0) {
model.addAttribute("datasetCount", s.getSampleOutput().size());
List<SerializableResource> sampleOutput = sessionService.loadSampleOutput(s.getId());
if (sampleOutput!=null && sampleOutput.size()>0) {
model.addAttribute("datasetCount", sampleOutput.size());
model.addAttribute("datasetCurrent", s.getSelectedOutputIndex());
} else {
model.addAttribute("datasetCount", 0);
......@@ -421,15 +482,15 @@ public abstract class BaseMainEditorController extends BaseScheregController {
private Resource[] getResource(PersistedSession s, boolean single, boolean target) {
if (target) {
if (single) {
return new Resource[] {s.getSampleMapped().get(s.getSelectedOutputIndex())};
return new Resource[] {sessionService.loadSampleMapped(s.getId()).get(s.getSelectedOutputIndex())};
} else {
return s.getSampleMapped().toArray(new Resource[0]);
return sessionService.loadSampleMapped(s.getId()).toArray(new Resource[0]);
}