|
20 | 20 |
|
21 | 21 | import java.util.List;
|
22 | 22 |
|
23 |
| -import org.apache.isis.applib.AbstractFactoryAndRepository; |
24 | 23 | import org.apache.isis.applib.annotation.Action;
|
25 | 24 | import org.apache.isis.applib.annotation.ActionLayout;
|
26 |
| -import org.apache.isis.applib.annotation.DomainService; |
27 |
| -import org.apache.isis.applib.annotation.NatureOfService; |
| 25 | +import org.apache.isis.applib.annotation.Mixin; |
28 | 26 | import org.apache.isis.applib.annotation.Optionality;
|
29 | 27 | import org.apache.isis.applib.annotation.Parameter;
|
30 | 28 | import org.apache.isis.applib.annotation.SemanticsOf;
|
31 |
| -import org.apache.isis.applib.services.queryresultscache.QueryResultsCache; |
32 | 29 |
|
33 |
| -import todoapp.dom.todoitem.ToDoItems; |
| 30 | +@Mixin |
| 31 | +public class Categorized_updateCategory { |
34 | 32 |
|
35 |
| -@DomainService(nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY) |
36 |
| -public class UpdateCategoryContributions extends AbstractFactoryAndRepository { |
| 33 | + private final Categorized categorized; |
| 34 | + |
| 35 | + public Categorized_updateCategory(final Categorized categorized) { |
| 36 | + this.categorized = categorized; |
| 37 | + } |
37 | 38 |
|
38 |
| - //region > updateCategory (contributed action) |
39 | 39 |
|
40 | 40 | @ActionLayout(
|
41 | 41 | describedAs = "Update category and subcategory"
|
42 | 42 | )
|
43 | 43 | @Action(semantics = SemanticsOf.IDEMPOTENT)
|
44 |
| - public Categorized updateCategory( |
45 |
| - final Categorized item, |
| 44 | + public Categorized $$( |
46 | 45 | final Category category,
|
47 | 46 | final @Parameter(optionality = Optionality.OPTIONAL) Subcategory subcategory) {
|
48 |
| - item.setCategory(category); |
49 |
| - item.setSubcategory(subcategory); |
50 |
| - return item; |
| 47 | + categorized.setCategory(category); |
| 48 | + categorized.setSubcategory(subcategory); |
| 49 | + return categorized; |
51 | 50 | }
|
52 |
| - public Category default1UpdateCategory( |
53 |
| - final Categorized item) { |
54 |
| - return item != null? item.getCategory(): null; |
| 51 | + public Category default0$$() { |
| 52 | + return categorized != null? categorized.getCategory(): null; |
55 | 53 | }
|
56 |
| - public Subcategory default2UpdateCategory( |
57 |
| - final Categorized item) { |
58 |
| - return item != null? item.getSubcategory(): null; |
| 54 | + public Subcategory default1$$() { |
| 55 | + return categorized != null? categorized.getSubcategory(): null; |
59 | 56 | }
|
60 | 57 |
|
61 |
| - public List<Subcategory> choices2UpdateCategory( |
62 |
| - final Categorized item, final Category category) { |
| 58 | + public List<Subcategory> choices1$$(final Category category) { |
63 | 59 | return Subcategory.listFor(category);
|
64 | 60 | }
|
65 | 61 |
|
66 |
| - public String validateUpdateCategory( |
67 |
| - final Categorized item, final Category category, final Subcategory subcategory) { |
| 62 | + public String validate$$( |
| 63 | + final Category category, final Subcategory subcategory) { |
68 | 64 | return Subcategory.validate(category, subcategory);
|
69 | 65 | }
|
70 |
| - //endregion |
71 |
| - |
72 |
| - //region > injected services |
73 |
| - @javax.inject.Inject |
74 |
| - private ToDoItems toDoItems; |
75 |
| - |
76 |
| - @javax.inject.Inject |
77 |
| - private QueryResultsCache queryResultsCache; |
78 |
| - //endregion |
79 |
| - |
80 | 66 | }
|
0 commit comments