Skip to content

Commit

Permalink
Merge branch 'master' into Production
Browse files Browse the repository at this point in the history
Added a reference to db.properties
  • Loading branch information
jezekp committed Aug 5, 2014
2 parents 928ab83 + d3aafd0 commit 26d4418
Show file tree
Hide file tree
Showing 34 changed files with 1,796 additions and 203 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ target
*.iml
bin
.project
src/main/webapp/WEB-INF/db.properties
.classpath
.settings
src/main/webapp/files/js/messages-en.json
Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,8 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<forkCount>1</forkCount>
<!--<reuseForks>false</reuseForks>-->
<argLine>-Xmx1024m</argLine>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public List<Article> getArticlesForUser(Person person) {
} else {
// We need to load only articles which can be viewed by the logged user.
// That is, we need to load only public articles or articles from the groups the logged user is member of.
query = "select DISTINCT a from Article a left join fetch a.articleComments where " +
query = "select DISTINCT a from Article a left join fetch a.articleComments where a.person.personId = :personId or " +
"a.researchGroup.researchGroupId is null or " +
"a.researchGroup.researchGroupId in " +
"(select rm.id.researchGroupId from ResearchGroupMembership rm where rm.id.personId = :personId) " +
Expand Down Expand Up @@ -122,7 +122,7 @@ public int getArticleCountForPerson(Person person) {
if (person.getAuthority().equals("ROLE_ADMIN")) {
return ((Long) getSession().createQuery("select count(*) from Article").uniqueResult()).intValue();
}
String query = "select count(*) from Article a where " +
String query = "select count(*) from Article a where a.person.personId = :personId or " +
"a.researchGroup.researchGroupId is null or " +
"a.researchGroup.researchGroupId in " +
"(select rm.id.researchGroupId from ResearchGroupMembership rm where rm.id.personId = :personId)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public File generate(Experiment exp, MetadataCommand mc, Set<DataFile> dataFiles

ZipEntry entry;

if (mc.isScenFile()) {
if (mc.isScenFile() && scen.getScenarioFile() != null) {
try {

log.debug("saving scenario file (" + scen.getScenarioName() + ") into a zip file");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.wicket.util.convert.ConversionException;
import org.apache.wicket.util.convert.IConverter;

import com.ibm.icu.text.SimpleDateFormat;
Expand Down Expand Up @@ -67,11 +68,13 @@ public TimestampConverter(String formatPattern, String parsePattern) {
@Override
public Timestamp convertToObject(String value, Locale locale) {
try {
return new Timestamp(new SimpleDateFormat(getParsePattern()).parse(value).getTime());

long time = new SimpleDateFormat(getParsePattern()).parse(value).getTime();
return new Timestamp(time);

} catch (ParseException e) {

log.error(e.getMessage(), e);
return null;
log.info(e.getMessage(), e);
throw new ConversionException("Wrong Date Format: " + parsePattern);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ <h1>
<th><wicket:message key="label.globalPermissionLevel" /></th>
<td wicket:id="authority"></td>
</tr>

</table>

<br/>
<a href="#" wicket:id="editLink" class="lightButtonLink"><wicket:message key="link.edit"></wicket:message></a>

<h2>
<wicket:message key='heading.membershipInGroups'></wicket:message>
</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import cz.zcu.kiv.eegdatabase.wui.core.person.PersonFacade;
import cz.zcu.kiv.eegdatabase.wui.ui.groups.ResearchGroupsDetailPage;
import cz.zcu.kiv.eegdatabase.wui.ui.home.HomePage;
import cz.zcu.kiv.eegdatabase.wui.ui.people.form.PersonFormPage;

/**
* Account overview page with logged user information
Expand Down Expand Up @@ -99,6 +100,9 @@ protected void populateItem(ListItem<ResearchGroupAccountInfo> item) {
}
};
groups.setVisibilityAllowed(!emptyGroups);
add(groups, noGroups);

BookmarkablePageLink<Void> editAccount = new BookmarkablePageLink<Void>("editLink", PersonFormPage.class, PageParametersUtils.getDefaultPageParameters(user.getPersonId()));

add(groups, noGroups, editAccount);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,49 +22,53 @@
******************************************************************************/
package cz.zcu.kiv.eegdatabase.wui.ui.experiments.components;

import cz.zcu.kiv.eegdatabase.data.pojo.Experiment;
import cz.zcu.kiv.eegdatabase.data.pojo.ExperimentPackage;
import cz.zcu.kiv.eegdatabase.data.pojo.License;
import cz.zcu.kiv.eegdatabase.data.pojo.LicenseType;
import cz.zcu.kiv.eegdatabase.wui.components.table.TimestampPropertyColumn;
import cz.zcu.kiv.eegdatabase.wui.components.table.ViewLinkPanel;
import cz.zcu.kiv.eegdatabase.wui.components.utils.ResourceUtils;
import cz.zcu.kiv.eegdatabase.wui.core.experiments.ExperimentsFacade;
import cz.zcu.kiv.eegdatabase.wui.ui.experiments.ExperimentsDetailPage;
import cz.zcu.kiv.eegdatabase.wui.ui.experiments.ListExperimentsDataProvider;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.extensions.model.AbstractCheckBoxModel;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.model.StringResourceModel;
import org.apache.wicket.spring.injection.annot.SpringBean;

import cz.zcu.kiv.eegdatabase.data.pojo.Experiment;
import cz.zcu.kiv.eegdatabase.data.pojo.ExperimentPackage;
import cz.zcu.kiv.eegdatabase.data.pojo.License;
import cz.zcu.kiv.eegdatabase.data.pojo.LicenseType;
import cz.zcu.kiv.eegdatabase.wui.components.table.CheckBoxColumn;
import cz.zcu.kiv.eegdatabase.wui.components.table.TimestampPropertyColumn;
import cz.zcu.kiv.eegdatabase.wui.components.table.ViewLinkPanel;
import cz.zcu.kiv.eegdatabase.wui.components.utils.ResourceUtils;
import cz.zcu.kiv.eegdatabase.wui.core.experimentpackage.ExperimentPackageFacade;
import cz.zcu.kiv.eegdatabase.wui.core.experiments.ExperimentsFacade;
import cz.zcu.kiv.eegdatabase.wui.core.license.LicenseFacade;
import cz.zcu.kiv.eegdatabase.wui.ui.experiments.ExperimentsDetailPage;
import cz.zcu.kiv.eegdatabase.wui.ui.experiments.ListExperimentsDataProvider;
import cz.zcu.kiv.eegdatabase.wui.ui.licenses.components.LicenseEditForm;
import cz.zcu.kiv.eegdatabase.wui.ui.licenses.components.PublicPrivateLicensePanel;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.extensions.model.AbstractCheckBoxModel;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.model.LoadableDetachableModel;

/**
* Panel for experiment package management. Adding/removing experiments and
Expand All @@ -73,6 +77,8 @@
* @author Jakub Danek
*/
public class ExperimentPackageManagePanel extends Panel {

protected Log log = LogFactory.getLog(getClass());

private static final int EXPERIMENTS_PER_PAGE = 10;
@SpringBean
Expand Down Expand Up @@ -348,7 +354,7 @@ protected List<License> load() {
protected void onSubmitAction(IModel<License> model, AjaxRequestTarget target, Form<?> form) {
License obj = model.getObject();
if (obj.getLicenseId() == 0) {
if(!obj.getTitle().equals(selectedBlueprintModel.getObject().getTitle())) {
if(selectedBlueprintModel.getObject() != null && !obj.getTitle().equals(selectedBlueprintModel.getObject().getTitle())) {
obj.setTemplate(true);
obj.setResearchGroup(epModel.getObject().getResearchGroup());
licenseFacade.create(obj);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,6 @@ protected void onConfigure() {

cont.add(ddc);
cont.add(licenseBuyLink);

// XXX HIDE LICENSE DROP DOWN CHOICE FOR NOW. FIX EXCEPTION !!!
cont.setVisibilityAllowed(false);
}


Expand Down
Loading

0 comments on commit 26d4418

Please sign in to comment.