Skip to content

Commit

Permalink
#117 removed UI for metadata stored in SQL DB, removed experiments wi…
Browse files Browse the repository at this point in the history
…zard step for metadata stored in SQL DB.
  • Loading branch information
rinkesj committed Jul 1, 2015
1 parent b8b3e7d commit 2582ddb
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 678 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public void setWeather(Weather weather) {
}

@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "SUBJECT_PERSON_ID", nullable = false)
@JoinColumn(name = "SUBJECT_PERSON_ID", nullable = true)
public Person getPersonBySubjectPersonId() {
return this.personBySubjectPersonId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
import cz.zcu.kiv.eegdatabase.wui.components.utils.ResourceUtils;
import cz.zcu.kiv.eegdatabase.wui.core.experiments.ExperimentsFacade;
import cz.zcu.kiv.eegdatabase.wui.core.file.FileFacade;
import cz.zcu.kiv.eegdatabase.wui.ui.experiments.forms.wizard.AddExperimentEnvironmentForm;
import cz.zcu.kiv.eegdatabase.wui.ui.experiments.forms.wizard.AddExperimentResultsForm;
import cz.zcu.kiv.eegdatabase.wui.ui.experiments.forms.wizard.AddExperimentScenarioForm;

Expand Down Expand Up @@ -103,7 +102,6 @@ private void setupComponents(final Model<Experiment> model) {

WizardModel wizardModel = new WizardModel();
wizardModel.add(new AddExperimentScenarioForm(model));
wizardModel.add(new AddExperimentEnvironmentForm(model));
wizardModel.add(new AddExperimentResultsForm(fileModel));

Wizard wizard = new Wizard("wizard", wizardModel, false) {
Expand All @@ -125,7 +123,8 @@ public void onFinish() {
Set<DataFile> files = new HashSet<DataFile>();
try {
List<FileUpload> fileUploadList = fileModel.getObject();
if (fileUploadList.isEmpty()) {
// files are required only for create experiment, not editation
if (experiment.getExperimentId() == 0 && fileUploadList.isEmpty()) {
this.error(ResourceUtils.getString("required.dataFile"));
setResponsePage(getPage());
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,12 @@ <h1>
<th><wicket:message key="label.endOfMeasuration" /></th>
<td wicket:id="endTime"></td>
</tr>
<tr>
<th><wicket:message key="label.temperature" /></th>
<td wicket:id="temperature"></td>
</tr>
<tr>
<th><wicket:message key="label.weather" /></th>
<td wicket:id="weather.title"></td>
</tr>
<tr>
<th><wicket:message key="label.weatherNote" /></th>
<td wicket:id="environmentNote"></td>
</tr>
<tr>
<th><wicket:message key="label.private" /></th>
<td wicket:id="privateExperiment"></td>
</tr>
</table>

<h2>
<wicket:message key="heading.subjectPerson" />
</h2>
Expand All @@ -91,6 +79,7 @@ <h2>
</wicket:enclosure>
</table>


<h2>
<wicket:message key="heading.scenario" />
</h2>
Expand All @@ -104,106 +93,9 @@ <h2>
key="link.viewDetailOfScenario" /></a></td>
</tr>
</table>

<h2>
<wicket:message key="heading.usedHardware" />
</h2>
<table class="dataTable" style="width: 450px;">
<thead>
<tr>
<th style="width: 250px;"><wicket:message key="dataTable.heading.hardwareTitle" /></th>
<th><wicket:message key="dataTable.heading.hardwareType" /></th>
</tr>
</thead>
<tr wicket:id="hardware">
<td wicket:id="title"></td>
<td wicket:id="type"></td>
</tr>
</table>

<h2>
<wicket:message key="label.software" />
</h2>
<table class="dataTable" style="width: 450px;">
<thead>
<tr>
<th style="width: 250px;"><wicket:message key="label.title" /></th>
<th><wicket:message key="label.description" /></th>
</tr>
</thead>
<tr wicket:id="software">
<td wicket:id="title"></td>
<td wicket:id="description"></td>
</tr>
</table>

<h2>
<wicket:message key="label.disease" />
</h2>
<table class="dataTable" style="width: 450px;">
<thead>
<tr>
<th style="width: 250px;"><wicket:message key="label.title" /></th>
<th><wicket:message key="label.description" /></th>
</tr>
</thead>
<tr wicket:id="diseases">
<td wicket:id="title"></td>
<td wicket:id="description"></td>
</tr>
</table>

<h2>
<wicket:message key="label.pharmaceutical" />
</h2>
<table class="dataTable" style="width: 450px;">
<thead>
<tr>
<th style="width: 250px;"><wicket:message key="label.title" /></th>
<th><wicket:message key="label.description" /></th>
</tr>
</thead>
<tr wicket:id="pharmaceuticals">
<td wicket:id="title"></td>
<td wicket:id="description"></td>
</tr>
</table>

<h2>
<wicket:message key="label.projectType" />
</h2>
<table class="dataTable" style="width: 450px;">
<thead>
<tr>
<th style="width: 250px;"><wicket:message key="label.title" /></th>
<th><wicket:message key="label.description" /></th>
</tr>
</thead>
<tr wicket:id="projectTypes">
<td wicket:id="title"></td>
<td wicket:id="description"></td>
</tr>
</table>

<h2>
<wicket:message key="heading.optionalParameters" />
</h2>
<table class="dataTable" style="width: 450px;">
<thead>
<tr>
<th style="width: 250px;"><wicket:message
key="dataTable.heading.measurationOptionalParamName" /></th>
<th><wicket:message key="dataTable.heading.measurationOptionalParamValue" /></th>
</tr>
</thead>
<tr wicket:id="addParameters">
<td wicket:id="experimentOptParamDef.paramName"></td>
<td wicket:id="paramValue"></td>
</tr>
</table>

<h2>
Metadata
<wicket:message key="label.metadata"></wicket:message>
</h2>
<div wicket:id="sections">
<div wicket:id="section"></div>
Expand Down Expand Up @@ -236,7 +128,6 @@ <h2>
</table>

<div class="actionBox">
<a href="#" wicket:id="addParameterLink" class="lightButtonLink"><wicket:message:message key="button.addOptionalParameter"/></a>
<a href="#" wicket:id="addFileLink" class="lightButtonLink"><wicket:message:message key="button.addDataFile"/></a>
<a href="#" wicket:id="editExpLink" class="lightButtonLink"><wicket:message:message key="button.editExperiment"/></a>
<a href="#" wicket:id="metadataLink" class="lightButtonLink"><wicket:message:message key="button.metadataLink"/></a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,114 +113,34 @@ private void setupComponents(final int experimentId) {
final Experiment experiment = facade.getExperimentForDetail(experimentId);

add(new Label("experimentId", experiment.getExperimentId()+""));
add(new TimestampLabel("startTime", experiment.getStartTime(), StringUtils.DATE_TIME_FORMAT_PATTER));
add(new TimestampLabel("endTime", experiment.getEndTime(), StringUtils.DATE_TIME_FORMAT_PATTER));
add(new Label("temperature", experiment.getTemperature()+""));
add(new Label("weather.title", experiment.getWeather().getTitle()));
add(new Label("environmentNote", experiment.getEnvironmentNote()));
add(new Label("privateExperiment", experiment.isPrivateExperiment()+""));
add(new Label("scenario.title", experiment.getScenario().getTitle()));
add(new Label("price", experiment.getPrice()));

add(new TimestampLabel("startTime", experiment.getStartTime(), StringUtils.DATE_TIME_FORMAT_PATTER));
add(new TimestampLabel("endTime", experiment.getEndTime(), StringUtils.DATE_TIME_FORMAT_PATTER));

Person personBySubjectPersonId = experiment.getPersonBySubjectPersonId();
add(new TimestampLabel("dateOfBirth", personBySubjectPersonId.getDateOfBirth(), StringUtils.DATE_TIME_FORMAT_PATTER_ONLY_YEAR));
add(new EnumLabel<Gender>("gender", Gender.getGenderByShortcut(personBySubjectPersonId.getGender())));
add(new TimestampLabel("dateOfBirth", personBySubjectPersonId != null ? personBySubjectPersonId.getDateOfBirth() : null, StringUtils.DATE_TIME_FORMAT_PATTER_ONLY_YEAR));
add(new EnumLabel<Gender>("gender", (personBySubjectPersonId != null ? Gender.getGenderByShortcut(personBySubjectPersonId.getGender()) : null)));

BookmarkablePageLink<Void> personLink = new BookmarkablePageLink<Void>("personLink", PersonDetailPage.class, PageParametersUtils.getDefaultPageParameters(personBySubjectPersonId.getPersonId()));
personLink.setVisibilityAllowed(security.userCanViewPersonDetails(personBySubjectPersonId.getPersonId()));
BookmarkablePageLink<Void> personLink = new BookmarkablePageLink<Void>("personLink", PersonDetailPage.class, PageParametersUtils.getDefaultPageParameters(personBySubjectPersonId != null ? personBySubjectPersonId.getPersonId() : -1));
personLink.setVisibilityAllowed(personBySubjectPersonId != null && security.userCanViewPersonDetails(personBySubjectPersonId.getPersonId()));
add(personLink);

BookmarkablePageLink<Void> scenarioLink = new BookmarkablePageLink<Void>("scenarioLink", ScenarioDetailPage.class, PageParametersUtils.getDefaultPageParameters(experiment.getScenario().getScenarioId()));
add(scenarioLink);

// TODO action box pages
boolean coexperiment = security.userIsOwnerOrCoexperimenter(experimentId) || security.isAdmin();
BookmarkablePageLink<Void> addParameterLink = new BookmarkablePageLink<Void>("addParameterLink", ExperimentOptParamValueFormPage.class, PageParametersUtils.getDefaultPageParameters(experimentId));
BookmarkablePageLink<Void> addFileLink = new BookmarkablePageLink<Void>("addFileLink", AddDataFilePage.class, PageParametersUtils.getDefaultPageParameters(experimentId));
BookmarkablePageLink<Void> editExpLink = new BookmarkablePageLink<Void>("editExpLink", ExperimentFormPage.class, PageParametersUtils.getDefaultPageParameters(experimentId));
BookmarkablePageLink<Void> metadataLink = new BookmarkablePageLink<Void>("metadataLink", MetadataFormPage.class, PageParametersUtils.getDefaultPageParameters(experimentId));
ExperimentBuyDownloadLinkPanel downloadExpLink = new ExperimentBuyDownloadLinkPanel("downloadExpLink", new Model<Experiment>(experiment));
downloadExpLink.setVisibilityAllowed(experiment.getExperimentPackageConnections().isEmpty());
add(addParameterLink.setVisibilityAllowed(coexperiment), addFileLink.setVisibilityAllowed(coexperiment), editExpLink.setVisibilityAllowed(coexperiment), metadataLink.setVisibilityAllowed(coexperiment), downloadExpLink);
add(addFileLink.setVisibilityAllowed(coexperiment), editExpLink.setVisibilityAllowed(coexperiment), metadataLink.setVisibilityAllowed(coexperiment), downloadExpLink);

/* XXX #66 Java Heap Space Exception : working with big data file in memory.
final ExperimentSignalViewCanvasPanel experimentViewPanel = new ExperimentSignalViewCanvasPanel("view", experiment);
*/

PropertyListView<Hardware> hardware = new PropertyListView<Hardware>("hardware", new ListModel<Hardware>(new ArrayList<Hardware>(experiment.getHardwares()))) {

private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItem<Hardware> item) {
item.add(new Label("title"));
item.add(new Label("type"));

}
};
PropertyListView<ExperimentOptParamVal> addParameters = new PropertyListView<ExperimentOptParamVal>("addParameters", new ListModel<ExperimentOptParamVal>(new ArrayList<ExperimentOptParamVal>(
experiment.getExperimentOptParamVals()))) {

private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItem<ExperimentOptParamVal> item) {
item.add(new Label("experimentOptParamDef.paramName"));
item.add(new Label("paramValue"));

}
};

PropertyListView<Software> software = new PropertyListView<Software>("software", new ListModel<Software>(new ArrayList<Software>(
experiment.getSoftwares()))) {

private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItem<Software> item) {
item.add(new Label("title"));
item.add(new Label("description"));

}
};

PropertyListView<Disease> diseases = new PropertyListView<Disease>("diseases", new ListModel<Disease>(new ArrayList<Disease>(
experiment.getDiseases()))) {

private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItem<Disease> item) {
item.add(new Label("title"));
item.add(new Label("description"));

}
};

PropertyListView<Pharmaceutical> pharmaceuticals = new PropertyListView<Pharmaceutical>("pharmaceuticals", new ListModel<Pharmaceutical>(new ArrayList<Pharmaceutical>(
experiment.getPharmaceuticals()))) {

private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItem<Pharmaceutical> item) {
item.add(new Label("title"));
item.add(new Label("description"));

}
};

PropertyListView<ProjectType> projectTypes = new PropertyListView<ProjectType>("projectTypes", new ListModel<ProjectType>(new ArrayList<ProjectType>(
experiment.getProjectTypes()))) {

private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItem<ProjectType> item) {
item.add(new Label("title"));
item.add(new Label("description"));

}
};

PropertyListView<Section> metadata = new PropertyListView<Section>("sections", new PropertyModel<List<Section>>(experiment.getElasticExperiment().getMetadata(), "sections")) {

Expand Down Expand Up @@ -278,7 +198,7 @@ public boolean isVisible() {
}
};

add(hardware, addParameters, files, software, diseases, pharmaceuticals, projectTypes);
add(files);

final WebMarkupContainer container = new WebMarkupContainer("container");
container.setOutputMarkupId(true);
Expand Down

This file was deleted.

Loading

0 comments on commit 2582ddb

Please sign in to comment.