changes in profile panel to show new researchareas instead of area keywords
This commit is contained in:
parent
324a3fb46b
commit
aedf8c01ca
@ -18,6 +18,7 @@ import org.apache.wicket.spring.injection.annot.SpringBean;
|
||||
import se.su.dsv.scipro.data.dao.interfaces.LanguageDao;
|
||||
import se.su.dsv.scipro.data.dataobjects.Employee;
|
||||
import se.su.dsv.scipro.data.dataobjects.Language;
|
||||
import se.su.dsv.scipro.data.dataobjects.ResearchArea;
|
||||
import se.su.dsv.scipro.keywords.KeywordContainer;
|
||||
import se.su.dsv.scipro.keywords.SelectKeywordsPanel;
|
||||
import se.su.dsv.scipro.match.dao.interfaces.KeywordDao;
|
||||
@ -26,6 +27,7 @@ import se.su.dsv.scipro.match.dao.interfaces.KeywordTypeDao.TYPE;
|
||||
import se.su.dsv.scipro.match.dao.interfaces.SupervisorDao;
|
||||
import se.su.dsv.scipro.match.dataobject.Keyword;
|
||||
import se.su.dsv.scipro.match.dataobject.KeywordType;
|
||||
import se.su.dsv.scipro.springdata.services.ResearchAreaService;
|
||||
|
||||
/**
|
||||
* Author: fred
|
||||
@ -53,6 +55,8 @@ public class ProfilePanel extends Panel {
|
||||
@SpringBean
|
||||
KeywordTypeDao keywordTypeDao;
|
||||
@SpringBean
|
||||
ResearchAreaService areaService;
|
||||
@SpringBean
|
||||
KeywordDao keywordDao;
|
||||
|
||||
|
||||
@ -96,25 +100,23 @@ public class ProfilePanel extends Panel {
|
||||
add(new Label("unitlabel", employeeModel.getObject().getUnit().getTitle()));
|
||||
}
|
||||
|
||||
final KeywordType areaType = keywordTypeDao.findByType(KeywordTypeDao.TYPE.RESEARCH_AREA);
|
||||
|
||||
boolean atLeastOneActive = false;
|
||||
for (Keyword kw : employeeModel.getObject().getKeywords().getFiltered(areaType)){
|
||||
if (!kw.isDeleted()){
|
||||
for (ResearchArea area : employeeModel.getObject().getResearchAreas()){
|
||||
if (!area.isDeleted()){
|
||||
atLeastOneActive = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
add(new Label("emptylabel", "You do not have any active/existing research areas selected in Daisy. Please make sure that you select at least one active/existing research area in Daisy ASAP.").setVisible(employeeModel.getObject().getKeywords().getFiltered(areaType) == null || employeeModel.getObject().getKeywords().getFiltered(areaType).isEmpty() || !atLeastOneActive));
|
||||
add(new Label("emptylabel", "You do not have any active/existing research areas selected in Daisy. Please make sure that you select at least one active/existing research area in Daisy ASAP.").setVisible(employeeModel.getObject().getResearchAreas() == null || employeeModel.getObject().getResearchAreas().isEmpty() || !atLeastOneActive));
|
||||
|
||||
ListView<Keyword> areaListView = new ListView<Keyword>("arealistview", new ArrayList<Keyword>(keywordDao.findAllFromType(areaType, false))){
|
||||
ListView<ResearchArea> areaListView = new ListView<ResearchArea>("arealistview", new ArrayList<ResearchArea>(areaService.findAllAsList())){
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Override
|
||||
protected void populateItem(ListItem<Keyword> item) {
|
||||
final Keyword kw = item.getModelObject();
|
||||
item.add(new Label("arealabel", kw.getKeyword()));
|
||||
if (!employeeModel.getObject().getKeywords().getFiltered(areaType).contains(kw)){
|
||||
protected void populateItem(ListItem<ResearchArea> item) {
|
||||
final ResearchArea area = item.getModelObject();
|
||||
item.add(new Label("arealabel", area.getTitle()));
|
||||
if (!employeeModel.getObject().getResearchAreas().contains(area)){
|
||||
item.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user