◆ addExt()
void org.turro.web.funnel.model.FunnelItemsVM.addExt |
( |
| ) |
|
Definition at line 134 of file FunnelItemsVM.java.
135 Dialogs.title(I_.get(
"Add external"))
138 .addField(DialogField.field(
"Type")
139 .help(
"https://www.turro.org/docs/elephant/components/webactions")
141 WebActionTypeListbox wat = new WebActionTypeListbox();
142 wat.setMold(
"select");
143 wat.setObjectValue(WebActionType.NAVIGATE);
146 .addField(DialogField.field(
"Value"))
147 .addField(DialogField.field(
"Icon"))
149 WebActionType type = dialogs.<WebActionTypeListbox>getEditor(
"Type").getObjectValue();
150 String value = dialogs.<Textbox>getEditor(
"Value").getValue();
151 String image = dialogs.<Textbox>getEditor(
"Icon").getValue();
152 if(type !=
null && !Strings.isBlank(value)) {
153 selected.
getExternals().add(type.getProtocol() +
":" + value +
154 (Strings.isBlank(image) ?
"" :
"{" + image +
"}"));
155 BindUtils.postNotifyChange(
null,
null, FunnelItemsVM.this,
Set< String > getExternals()
◆ addGoal()
void org.turro.web.funnel.model.FunnelItemsVM.addGoal |
( |
@BindingParam("goal") WebGoal |
goal | ) |
|
◆ addItem()
void org.turro.web.funnel.model.FunnelItemsVM.addItem |
( |
| ) |
|
Definition at line 81 of file FunnelItemsVM.java.
82 Dialogs.title(I_.get(
"Add"))
85 .addField(DialogField.field(
"WebTag"))
86 .addField(DialogField.field(
"Type").onEditor(() -> {
87 WebItemTypeListbox wit = new WebItemTypeListbox();
88 wit.setMold(
"select");
89 wit.setObjectValue(WebItemType.TARGET);
93 String webTag = dialogs.<Textbox>getEditor(
"WebTag").getValue();
94 if(notInModel(webTag)) {
95 WebItem wi =
new WebItem();
97 wi.setType(dialogs.<WebItemTypeListbox>getEditor(
"Type").getObjectValue());
101 BindUtils.postNotifyChange(
null,
null, FunnelItemsVM.this,
102 "model",
"selected",
"showForm");
104 Toasts.message(
"WebTags should not include spaces or punctuation characters.").show();
107 Toasts.message(
"WebTag already in the model.").show();
◆ addNext()
void org.turro.web.funnel.model.FunnelItemsVM.addNext |
( |
@BindingParam("next") WebItem |
item | ) |
|
◆ delete()
void org.turro.web.funnel.model.FunnelItemsVM.delete |
( |
| ) |
|
Definition at line 163 of file FunnelItemsVM.java.
164 Messages.confirmDeletion().add(selected.
getItemLabel()).show(() -> {
165 dao.get().deleteObject(selected);
166 Executions.getCurrent().sendRedirect(
null);
◆ deleteExt()
void org.turro.web.funnel.model.FunnelItemsVM.deleteExt |
( |
@BindingParam("ext") String |
item | ) |
|
Definition at line 186 of file FunnelItemsVM.java.
187 Messages.confirmDeletion().add(item).show(() -> {
189 BindUtils.postNotifyChange(
null,
null, FunnelItemsVM.this,
◆ deleteGoal()
void org.turro.web.funnel.model.FunnelItemsVM.deleteGoal |
( |
@BindingParam("goal") WebGoal |
goal | ) |
|
Definition at line 178 of file FunnelItemsVM.java.
179 Messages.confirmDeletion().add(goal.getItemLabel()).show(() -> {
181 BindUtils.postNotifyChange(
null,
null, FunnelItemsVM.this,
182 "model",
"selected");
◆ deleteNext()
void org.turro.web.funnel.model.FunnelItemsVM.deleteNext |
( |
@BindingParam("next") WebItem |
item | ) |
|
Definition at line 170 of file FunnelItemsVM.java.
171 Messages.confirmDeletion().add(item.getItemLabel()).show(() -> {
173 BindUtils.postNotifyChange(
null,
null, FunnelItemsVM.this,
174 "model",
"selected");
◆ getBehaveString()
String org.turro.web.funnel.model.FunnelItemsVM.getBehaveString |
( |
| ) |
|
Definition at line 64 of file FunnelItemsVM.java.
65 if(selected ==
null || behaveAs ==
null)
return "wrong";
66 if(selected.
getType().equals(behaveAs))
return "equal";
67 if(WebItemType.CHAIN.equals(behaveAs))
return "wrong";
68 return behaveAs.toString();
◆ getGoalsModel()
List<WebGoal> org.turro.web.funnel.model.FunnelItemsVM.getGoalsModel |
( |
| ) |
|
Definition at line 237 of file FunnelItemsVM.java.
238 if(selected ==
null)
return Collections.EMPTY_LIST;
239 return SqlClause.select(
"wg").from(
"WebGoal wg")
240 .where().notIn(
"goalAction", selected.
getGoals().stream().map(wi -> wi.getGoalAction()).toList())
242 .resultList(WebGoal.class);
◆ getGraphDOT()
String org.turro.web.funnel.model.FunnelItemsVM.getGraphDOT |
( |
| ) |
|
Definition at line 71 of file FunnelItemsVM.java.
72 Writer writer =
new StringWriter();
73 FunnelGraphDOT.DOT(writer);
74 return writer.toString();
◆ getModel()
List<WebItem> org.turro.web.funnel.model.FunnelItemsVM.getModel |
( |
| ) |
|
Definition at line 217 of file FunnelItemsVM.java.
219 model = SqlClause.select(
"wi").from(
"WebItem wi")
220 .orderBy(
"type, ordering, webTag")
222 .resultList(WebItem.class);
◆ getNextsModel()
List<WebItem> org.turro.web.funnel.model.FunnelItemsVM.getNextsModel |
( |
| ) |
|
Definition at line 227 of file FunnelItemsVM.java.
228 if(selected ==
null)
return Collections.EMPTY_LIST;
229 return SqlClause.select(
"wi").from(
"WebItem wi")
230 .where().in(
"type", getPossibleNextTypes())
231 .and().notEqual(
"webTag", selected.
getWebTag())
232 .and().notIn(
"webTag", selected.
getNexts().stream().map(wi -> wi.getWebTag()).toList())
234 .resultList(WebItem.class);
◆ getSelected()
WebItem org.turro.web.funnel.model.FunnelItemsVM.getSelected |
( |
| ) |
|
◆ isShowForm()
boolean org.turro.web.funnel.model.FunnelItemsVM.isShowForm |
( |
| ) |
|
◆ save()
void org.turro.web.funnel.model.FunnelItemsVM.save |
( |
| ) |
|
Definition at line 115 of file FunnelItemsVM.java.
116 model.stream().filter(wi -> wi.isEmpty() && !wi.isNew())
117 .forEach(wi -> dao.get().deleteEntity(wi));
118 model.removeIf(wi -> wi.isEmpty());
119 model.forEach(wi -> wi.compose());
120 dao.get().saveEntities(model);
121 Executions.getCurrent().sendRedirect(
null);
◆ setSelected()
void org.turro.web.funnel.model.FunnelItemsVM.setSelected |
( |
WebItem |
selected | ) |
|
Definition at line 57 of file FunnelItemsVM.java.
58 this.selected = selected;
59 this.behaveAs = FunnelGraph.behaveAs(selected);
60 BindUtils.postNotifyChange(
null,
null, FunnelItemsVM.this,
61 "selected",
"behaveString",
"showForm",
"nextsModel");
The documentation for this class was generated from the following file: