use of org.olat.portfolio.manager.EPArtefactTagCloud in project OpenOLAT by OpenOLAT.
the class EPTagBrowseController method recalculateTagCloud.
private List<AbstractArtefact> recalculateTagCloud() {
List<String> selectedTags = getSelectedTags();
if (selectedTags.isEmpty()) {
for (Link tagLink : tagLinks) {
TagWrapper tagWrapper = (TagWrapper) tagLink.getUserObject();
tagLink.setCustomEnabledLinkCSS(inactiveCSS);
tagLink.setEnabled(true);
tagWrapper.setState(TagState.possible);
}
return allUsersArtefacts;
}
EPArtefactTagCloud artefactsAndTags = ePFMgr.getArtefactsAndTagCloud(getIdentity(), selectedTags);
List<AbstractArtefact> filteredArtefacts = artefactsAndTags.getArtefacts();
Set<String> newTags = artefactsAndTags.getTags();
if (newTags != null && !newTags.isEmpty()) {
for (Link tagLink : tagLinks) {
TagWrapper tagWrapper = (TagWrapper) tagLink.getUserObject();
String tag = tagWrapper.getTag();
switch(tagWrapper.getState()) {
case selected:
tagLink.setCustomEnabledLinkCSS(activeCSS);
tagLink.setEnabled(true);
break;
case possible:
if (!newTags.contains(tag)) {
tagWrapper.setState(TagState.unpossible);
tagLink.setEnabled(false);
} else {
tagLink.setCustomEnabledLinkCSS(inactiveCSS);
tagLink.setEnabled(true);
}
break;
case unpossible:
if (newTags.contains(tag)) {
tagWrapper.setState(TagState.possible);
tagLink.setCustomEnabledLinkCSS(inactiveCSS);
tagLink.setEnabled(true);
} else {
tagLink.setEnabled(false);
}
break;
}
}
}
return filteredArtefacts;
}
use of org.olat.portfolio.manager.EPArtefactTagCloud in project openolat by klemens.
the class EPTagBrowseController method recalculateTagCloud.
private List<AbstractArtefact> recalculateTagCloud() {
List<String> selectedTags = getSelectedTags();
if (selectedTags.isEmpty()) {
for (Link tagLink : tagLinks) {
TagWrapper tagWrapper = (TagWrapper) tagLink.getUserObject();
tagLink.setCustomEnabledLinkCSS(inactiveCSS);
tagLink.setEnabled(true);
tagWrapper.setState(TagState.possible);
}
return allUsersArtefacts;
}
EPArtefactTagCloud artefactsAndTags = ePFMgr.getArtefactsAndTagCloud(getIdentity(), selectedTags);
List<AbstractArtefact> filteredArtefacts = artefactsAndTags.getArtefacts();
Set<String> newTags = artefactsAndTags.getTags();
if (newTags != null && !newTags.isEmpty()) {
for (Link tagLink : tagLinks) {
TagWrapper tagWrapper = (TagWrapper) tagLink.getUserObject();
String tag = tagWrapper.getTag();
switch(tagWrapper.getState()) {
case selected:
tagLink.setCustomEnabledLinkCSS(activeCSS);
tagLink.setEnabled(true);
break;
case possible:
if (!newTags.contains(tag)) {
tagWrapper.setState(TagState.unpossible);
tagLink.setEnabled(false);
} else {
tagLink.setCustomEnabledLinkCSS(inactiveCSS);
tagLink.setEnabled(true);
}
break;
case unpossible:
if (newTags.contains(tag)) {
tagWrapper.setState(TagState.possible);
tagLink.setCustomEnabledLinkCSS(inactiveCSS);
tagLink.setEnabled(true);
} else {
tagLink.setEnabled(false);
}
break;
}
}
}
return filteredArtefacts;
}
Aggregations