Skip to content

Commit

Permalink
schema updates: table title fix; minor renaming; icons
Browse files Browse the repository at this point in the history
  • Loading branch information
andi-huber committed Mar 19, 2024
1 parent 81ad041 commit a7ba701
Show file tree
Hide file tree
Showing 18 changed files with 184 additions and 156 deletions.
7 changes: 5 additions & 2 deletions globodiet/manager/src/main/resources/menubars.layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,15 @@
<mb:serviceAction objectType="dita.globodiet.params.EntitiesMenu" id="manageQuantificationMethodPathwayForRecipeGroup"/>
<mb:serviceAction objectType="dita.globodiet.params.EntitiesMenu" id="manageProbingQuestionPathwayForRecipe"/>
</mb:section>
</mb:menu>
<mb:menu>
<mb:named>Quanitfication</mb:named>
<mb:section>
<mb:named>Quanitfication</mb:named>
<mb:serviceAction objectType="dita.globodiet.params.EntitiesMenu" id="manageStandardPortionForFood"/>
<mb:serviceAction objectType="dita.globodiet.params.EntitiesMenu" id="manageStandardUnitForFoodOrRecipe"/>
<mb:serviceAction objectType="dita.globodiet.params.EntitiesMenu" id="managePhoto"/>
<mb:serviceAction objectType="dita.globodiet.params.EntitiesMenu" id="manageShape"/>
<mb:serviceAction objectType="dita.globodiet.params.EntitiesMenu" id="manageThicknessForShape"/>
</mb:section>
</mb:menu>
<mb:menu>
Expand Down Expand Up @@ -183,7 +186,7 @@
<mb:serviceAction objectType="dita.globodiet.params.EntitiesMenu" id="manageStandardPortionForFood"/>
<mb:serviceAction objectType="dita.globodiet.params.EntitiesMenu" id="manageStandardUnitForFoodOrRecipe"/>
<mb:serviceAction objectType="dita.globodiet.params.EntitiesMenu" id="manageSubjectToBeInterviewed"/>
<mb:serviceAction objectType="dita.globodiet.params.EntitiesMenu" id="manageThicknessForShapeMethod"/>
<mb:serviceAction objectType="dita.globodiet.params.EntitiesMenu" id="manageThicknessForShape"/>
<mb:serviceAction objectType="dita.globodiet.params.EntitiesMenu" id="manageTranslationInCountryLanguage"/>
</mb:section>
</mb:menu>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@
import dita.globodiet.dom.params.quantif.StandardUnitForFoodOrRecipeDeps;
import dita.globodiet.dom.params.quantif.StandardUnitForFoodOrRecipe_delete;
import dita.globodiet.dom.params.quantif.StandardUnitForFoodOrRecipe_foodOrRecipe;
import dita.globodiet.dom.params.quantif.ThicknessForShapeMethod;
import dita.globodiet.dom.params.quantif.ThicknessForShapeMethodDeps;
import dita.globodiet.dom.params.quantif.ThicknessForShapeMethod_delete;
import dita.globodiet.dom.params.quantif.ThicknessForShapeMethod_foodSubgroups;
import dita.globodiet.dom.params.quantif.ThicknessForShapeMethod_recipeSubgroups;
import dita.globodiet.dom.params.quantif.ThicknessForShape;
import dita.globodiet.dom.params.quantif.ThicknessForShapeDeps;
import dita.globodiet.dom.params.quantif.ThicknessForShape_delete;
import dita.globodiet.dom.params.quantif.ThicknessForShape_foodSubgroups;
import dita.globodiet.dom.params.quantif.ThicknessForShape_recipeSubgroups;
import dita.globodiet.dom.params.recipe_coefficient.PercentOfFatOrSauceOrSweetenerAddedAfterCookingForRecipe;
import dita.globodiet.dom.params.recipe_coefficient.PercentOfFatOrSauceOrSweetenerAddedAfterCookingForRecipeDeps;
import dita.globodiet.dom.params.recipe_coefficient.PercentOfFatOrSauceOrSweetenerAddedAfterCookingForRecipe_delete;
Expand Down Expand Up @@ -452,7 +452,7 @@
StandardPortionForFood.class,
StandardUnitForFoodOrRecipe.class,
SubjectToBeInterviewed.class,
ThicknessForShapeMethod.class,
ThicknessForShape.class,
TranslationInCountryLanguage.class,

// Submodules,
Expand Down Expand Up @@ -525,7 +525,7 @@
StandardPortionForFoodDeps.class,
StandardUnitForFoodOrRecipeDeps.class,
SubjectToBeInterviewedDeps.class,
ThicknessForShapeMethodDeps.class,
ThicknessForShapeDeps.class,
TranslationInCountryLanguageDeps.class,

// Mixins,
Expand Down Expand Up @@ -735,9 +735,9 @@
SubjectToBeInterviewed_center.class,
SubjectToBeInterviewed_country.class,
SubjectToBeInterviewed_delete.class,
ThicknessForShapeMethod_delete.class,
ThicknessForShapeMethod_foodSubgroups.class,
ThicknessForShapeMethod_recipeSubgroups.class,
ThicknessForShape_delete.class,
ThicknessForShape_foodSubgroups.class,
ThicknessForShape_recipeSubgroups.class,
TranslationInCountryLanguage_delete.class
})
public class DitaModuleGdParams {
Expand Down Expand Up @@ -811,7 +811,7 @@ public static Can<Class<?>> entityClasses() {
StandardPortionForFood.class,
StandardUnitForFoodOrRecipe.class,
SubjectToBeInterviewed.class,
ThicknessForShapeMethod.class,
ThicknessForShape.class,
TranslationInCountryLanguage.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand All @@ -19,14 +19,6 @@
// Auto-generated by DitA-Tooling
package dita.globodiet.dom.params;

import jakarta.inject.Inject;
import jakarta.inject.Named;

import org.apache.causeway.applib.annotation.Action;
import org.apache.causeway.applib.annotation.ActionLayout;
import org.apache.causeway.applib.annotation.DomainService;
import org.apache.causeway.applib.services.factory.FactoryService;

import dita.commons.services.search.SearchService;
import dita.globodiet.dom.params.food_coefficient.DensityFactorForFoodOrRecipe;
import dita.globodiet.dom.params.food_coefficient.EdiblePartCoefficientForFood;
Expand Down Expand Up @@ -70,7 +62,7 @@
import dita.globodiet.dom.params.quantif.Shape;
import dita.globodiet.dom.params.quantif.StandardPortionForFood;
import dita.globodiet.dom.params.quantif.StandardUnitForFoodOrRecipe;
import dita.globodiet.dom.params.quantif.ThicknessForShapeMethod;
import dita.globodiet.dom.params.quantif.ThicknessForShape;
import dita.globodiet.dom.params.recipe_coefficient.PercentOfFatOrSauceOrSweetenerAddedAfterCookingForRecipe;
import dita.globodiet.dom.params.recipe_description.RecipeBrand;
import dita.globodiet.dom.params.recipe_description.RecipeDescriptor;
Expand Down Expand Up @@ -99,9 +91,17 @@
import dita.globodiet.dom.params.supplement.DietarySupplementClassification;
import dita.globodiet.dom.params.supplement.DietarySupplementDescriptor;
import dita.globodiet.dom.params.supplement.DietarySupplementFacet;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import org.apache.causeway.applib.annotation.Action;
import org.apache.causeway.applib.annotation.ActionLayout;
import org.apache.causeway.applib.annotation.DomainService;
import org.apache.causeway.applib.services.factory.FactoryService;

@Named("dita.globodiet.params.EntitiesMenu")
@DomainService
@DomainService(
nature = org.apache.causeway.applib.annotation.NatureOfService.VIEW
)
public class EntitiesMenu {
@Inject
private FactoryService factoryService;
Expand Down Expand Up @@ -442,21 +442,27 @@ public Shape.Manager manageShape() {
}

@Action
@ActionLayout
@ActionLayout(
cssClassFa = "solid bowl-rice"
)
public StandardPortionForFood.Manager manageStandardPortionForFood() {
return factoryService.viewModel(new StandardPortionForFood.Manager(searchService, ""));
}

@Action
@ActionLayout
@ActionLayout(
cssClassFa = "solid shapes"
)
public StandardUnitForFoodOrRecipe.Manager manageStandardUnitForFoodOrRecipe() {
return factoryService.viewModel(new StandardUnitForFoodOrRecipe.Manager(searchService, ""));
}

@Action
@ActionLayout
public ThicknessForShapeMethod.Manager manageThicknessForShapeMethod() {
return factoryService.viewModel(new ThicknessForShapeMethod.Manager(searchService, ""));
@ActionLayout(
cssClassFa = "solid ruler-horizontal"
)
public ThicknessForShape.Manager manageThicknessForShape() {
return factoryService.viewModel(new ThicknessForShape.Manager(searchService, ""));
}

@Action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
import dita.globodiet.dom.params.quantif.MaximumValueForFoodOrGroup;
import dita.globodiet.dom.params.quantif.MaximumValueForFoodOrGroup_foodSubSubgroup;
import dita.globodiet.dom.params.quantif.MaximumValueForFoodOrGroup_foodSubgroup;
import dita.globodiet.dom.params.quantif.ThicknessForShapeMethod;
import dita.globodiet.dom.params.quantif.ThicknessForShapeMethod_foodSubgroups;
import dita.globodiet.dom.params.quantif.ThicknessForShape;
import dita.globodiet.dom.params.quantif.ThicknessForShape_foodSubgroups;
import dita.globodiet.dom.params.recipe_coefficient.PercentOfFatOrSauceOrSweetenerAddedAfterCookingForRecipe;
import dita.globodiet.dom.params.recipe_coefficient.PercentOfFatOrSauceOrSweetenerAddedAfterCookingForRecipe_fssSubSubgroup;
import dita.globodiet.dom.params.recipe_coefficient.PercentOfFatOrSauceOrSweetenerAddedAfterCookingForRecipe_fssSubgroup;
Expand Down Expand Up @@ -111,7 +111,7 @@ public static Can<Class<?>> mixinClasses() {
FoodSubgroup_dependentQuantificationMethodPathwayForFoodGroupMappedByFoodSubSubgroup.class,
FoodSubgroup_dependentMaximumValueForFoodOrGroupMappedByFoodSubgroup.class,
FoodSubgroup_dependentMaximumValueForFoodOrGroupMappedByFoodSubSubgroup.class,
FoodSubgroup_dependentThicknessForShapeMethodMappedByFoodSubgroups.class,
FoodSubgroup_dependentThicknessForShapeMappedByFoodSubgroups.class,
FoodSubgroup_dependentPercentOfFatOrSauceOrSweetenerAddedAfterCookingForRecipeMappedByFssSubgroup.class,
FoodSubgroup_dependentPercentOfFatOrSauceOrSweetenerAddedAfterCookingForRecipeMappedByFssSubSubgroup.class,
FoodSubgroup_dependentRecipeIngredientMappedByFoodOrRecipeSubgroup.class,
Expand Down Expand Up @@ -714,18 +714,18 @@ public List<MaximumValueForFoodOrGroup> coll() {
tableDecorator = CollectionTitleDecorator.class
)
@RequiredArgsConstructor
public static class FoodSubgroup_dependentThicknessForShapeMethodMappedByFoodSubgroups {
public static class FoodSubgroup_dependentThicknessForShapeMappedByFoodSubgroups {
@Inject
DependantLookupService dependantLookup;

private final FoodSubgroup mixee;

@MemberSupport
public List<ThicknessForShapeMethod> coll() {
public List<ThicknessForShape> coll() {
return dependantLookup.findDependants(
ThicknessForShapeMethod.class,
ThicknessForShapeMethod_foodSubgroups.class,
ThicknessForShapeMethod_foodSubgroups::coll,
ThicknessForShape.class,
ThicknessForShape_foodSubgroups.class,
ThicknessForShape_foodSubgroups::coll,
mixee);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public class RecipeIngredientQuantification_shapeThickness {
private final RecipeIngredientQuantification mixee;

@MemberSupport
public ThicknessForShapeMethod prop() {
public ThicknessForShape prop() {
if(mixee.getShapeThicknessCode()==null) return null;
final var lookupKey = new ThicknessForShapeMethod.SecondaryKey(mixee.getShapeThicknessCode());
final var lookupKey = new ThicknessForShape.SecondaryKey(mixee.getShapeThicknessCode());
return foreignKeyLookup.nullable(lookupKey);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
@Named("dita.globodiet.params.quantif.StandardPortionForFood")
@DomainObject
@DomainObjectLayout(
describedAs = "standard portions for foods"
describedAs = "standard portions for foods",
cssClassFa = "solid bowl-rice"
)
@PersistenceCapable(
table = "M_STDPOR"
Expand Down Expand Up @@ -92,7 +93,7 @@ public class StandardPortionForFood implements Cloneable<StandardPortionForFood>
)
@Getter
@Setter
private double standardPortionQuantity;
private double quantity;

/**
* Food identification number (=FOODMUM)
Expand Down Expand Up @@ -203,7 +204,7 @@ public class StandardPortionForFood implements Cloneable<StandardPortionForFood>
)
@Getter
@Setter
private String commentAttachedToTheStandardPortion;
private String comment;

/**
* Standard portion code for the same food (0001, 0002, 0003)
Expand All @@ -225,7 +226,7 @@ public class StandardPortionForFood implements Cloneable<StandardPortionForFood>
)
@Getter
@Setter
private String standardPortionCode;
private String code;

/**
* G = in grams, V = in ml (volume)
Expand Down Expand Up @@ -268,37 +269,37 @@ public class StandardPortionForFood implements Cloneable<StandardPortionForFood>
)
@Getter
@Setter
private double orderToDisplayTheStandardPortion;
private double displayOrder;

@ObjectSupport
public String title() {
return this.toString();
return String.format("%s (foodCode=%s, quantity=%.3f, unit=%s, comment=%s)", code, foodCode, quantity, unit, comment);
}

@Override
public String toString() {
return "StandardPortionForFood(" + "standardPortionQuantity=" + getStandardPortionQuantity() + ","
return "StandardPortionForFood(" + "quantity=" + getQuantity() + ","
+"foodCode=" + getFoodCode() + ","
+"rawOrCooked=" + getRawOrCooked() + ","
+"withUnediblePartQ=" + getWithUnediblePartQ() + ","
+"commentAttachedToTheStandardPortion=" + getCommentAttachedToTheStandardPortion() + ","
+"standardPortionCode=" + getStandardPortionCode() + ","
+"comment=" + getComment() + ","
+"code=" + getCode() + ","
+"unit=" + getUnit() + ","
+"orderToDisplayTheStandardPortion=" + getOrderToDisplayTheStandardPortion() + ")";
+"displayOrder=" + getDisplayOrder() + ")";
}

@Programmatic
@Override
public StandardPortionForFood copy() {
var copy = repositoryService.detachedEntity(new StandardPortionForFood());
copy.setStandardPortionQuantity(getStandardPortionQuantity());
copy.setQuantity(getQuantity());
copy.setFoodCode(getFoodCode());
copy.setRawOrCooked(getRawOrCooked());
copy.setWithUnediblePartQ(getWithUnediblePartQ());
copy.setCommentAttachedToTheStandardPortion(getCommentAttachedToTheStandardPortion());
copy.setStandardPortionCode(getStandardPortionCode());
copy.setComment(getComment());
copy.setCode(getCode());
copy.setUnit(getUnit());
copy.setOrderToDisplayTheStandardPortion(getOrderToDisplayTheStandardPortion());
copy.setDisplayOrder(getDisplayOrder());
return copy;
}

Expand Down Expand Up @@ -363,7 +364,8 @@ public enum WithUnediblePartQ {
*/
@Named("dita.globodiet.params.quantif.StandardPortionForFood.Manager")
@DomainObjectLayout(
describedAs = "standard portions for foods"
describedAs = "standard portions for foods",
cssClassFa = "solid bowl-rice"
)
@AllArgsConstructor
public static final class Manager implements ViewModel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
@Named("dita.globodiet.params.quantif.StandardUnitForFoodOrRecipe")
@DomainObject
@DomainObjectLayout(
describedAs = "standard units for foods and recipes"
describedAs = "standard units for foods and recipes",
cssClassFa = "solid shapes"
)
@PersistenceCapable(
table = "M_STDUTS"
Expand Down Expand Up @@ -318,7 +319,7 @@ public class StandardUnitForFoodOrRecipe implements Cloneable<StandardUnitForFoo

@ObjectSupport
public String title() {
return this.toString();
return String.format("%s (quantity=%.3f, comment=%s)", code, quantity, comment);
}

@Override
Expand Down Expand Up @@ -455,7 +456,8 @@ public enum Unit {
*/
@Named("dita.globodiet.params.quantif.StandardUnitForFoodOrRecipe.Manager")
@DomainObjectLayout(
describedAs = "standard units for foods and recipes"
describedAs = "standard units for foods and recipes",
cssClassFa = "solid shapes"
)
@AllArgsConstructor
public static final class Manager implements ViewModel {
Expand Down
Loading

0 comments on commit a7ba701

Please sign in to comment.