19 package org.turro.skills;
21 import java.util.stream.Collectors;
22 import org.turro.string.Strings;
23 import org.turro.action.Actions;
24 import org.turro.collections.KeyValueMap;
25 import org.turro.elephant.TemplateControl;
26 import org.turro.elephant.context.Application;
27 import org.turro.elephant.entities.db.Skill;
28 import org.turro.elephant.entities.db.SkillType;
29 import org.zkoss.zk.ui.event.InputEvent;
30 import org.zkoss.zk.ui.select.annotation.Listen;
31 import org.zkoss.zk.ui.select.annotation.Wire;
39 private String path, entityPath;
45 @Listen(
"onSelect=#knowledge")
48 .stream().map(s -> s.getFor(entityPath)).collect(Collectors.toSet()),
52 @Listen(
"onSelect=#functional")
55 .stream().map(s -> s.getFor(entityPath)).collect(Collectors.toSet()),
59 @Listen(
"onSelect=#attitude")
62 .stream().map(s -> s.getFor(entityPath)).collect(Collectors.toSet()),
66 @Listen(
"onSearch=#knowledge")
68 String value =
event.getValue();
69 if(!Strings.isBlank(value)) {
79 @Listen(
"onSearch=#functional")
81 String value =
event.getValue();
82 if(!Strings.isBlank(value)) {
92 @Listen(
"onSearch=#attitude")
94 String value =
event.getValue();
95 if(!Strings.isBlank(value)) {
105 @Listen(
"onClick=#cancel")
123 this.entityPath = entityPath;
130 if(kvm !=
null && kvm.containsKey(
"entityPath")) {
131 entityPath = kvm.get(
"entityPath");
136 private void initComponents() {
137 if(!Strings.isBlank(entityPath)) {
142 Application.getApplication().sendRedirect(path);
static KeyValueMap getRightNowAction(IConstructor constructor)
IConstructor getConstructor()
abstract void sendRedirect(String uri)
static Application getApplication()
void setSkill(String skill)
void setType(SkillType type)
void setEntityPath(String entityPath)
void setEntityPath(String entityPath)
void onNewAttitude(InputEvent event)
void onNewKnowledge(InputEvent event)
void setPath(String path)
void onNewFunctional(InputEvent event)
void addToModel(SkillRoot value)
Set< SkillRoot > getObjectValues()
void setObjectValues(Collection< SkillRoot > internalValues)
static List< SkillRoot > getSkillsAsRootFrom(String entityPath, SkillType... types)
static void setSkillsFor(String entityPath, Set< Skill > skills, SkillType... types)
static void addSkillFor(String entityPath, Skill skill)