Compare commits

..

No commits in common. "e7f373f6630862208422642ea06f5ed91f6e83a8" and "a4e70a0739ff58f625f44ca6fae291af189f081e" have entirely different histories.

7 changed files with 49 additions and 27 deletions

32
pom.xml
View File

@ -7,7 +7,7 @@
<groupId>com.mousetech.gourmet</groupId> <groupId>com.mousetech.gourmet</groupId>
<artifactId>gourmetj</artifactId> <artifactId>gourmetj</artifactId>
<version>0.2.7</version> <version>0.2.5</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>GourmetJ</name> <name>GourmetJ</name>
@ -84,6 +84,10 @@
<artifactId>gson</artifactId> <artifactId>gson</artifactId>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<!-- <dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
</dependency>-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId> <artifactId>spring-boot-starter-security</artifactId>
@ -92,6 +96,14 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId> <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency> </dependency>
<!--
https://mvnrepository.com/artifact/jakarta.persistence/jakarta.persistence-api -->
<!-- <dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
</dependency>-->
<dependency> <dependency>
<groupId>jakarta.validation</groupId> <groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId> <artifactId>jakarta.validation-api</artifactId>
@ -117,11 +129,21 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- <dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
-->
<dependency> <dependency>
<groupId>org.apache.tomcat.embed</groupId> <groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId> <artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- <dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.el</artifactId>
</dependency>
-->
<!-- <!--
https://mvnrepository.com/artifact/com.twelvemonkeys.imageio/imageio-core --> https://mvnrepository.com/artifact/com.twelvemonkeys.imageio/imageio-core -->
@ -136,6 +158,7 @@
</dependency> </dependency>
<!-- <!--
https://mvnrepository.com/artifact/com.twelvemonkeys.imageio/imageio-webp --> https://mvnrepository.com/artifact/com.twelvemonkeys.imageio/imageio-webp -->
<!-- In Core??? -->
<dependency> <dependency>
<groupId>com.twelvemonkeys.imageio</groupId> <groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-webp</artifactId> <artifactId>imageio-webp</artifactId>
@ -143,6 +166,7 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- Needed only if you deploy ImageIO plugins as part of a web app. <!-- Needed only if you deploy ImageIO plugins as part of a web app.
Make sure you add the IIOProviderContextListener to your web.xml.
--> -->
<dependency> <dependency>
<groupId>com.twelvemonkeys.servlet</groupId> <groupId>com.twelvemonkeys.servlet</groupId>
@ -160,6 +184,12 @@
<version>8.0.30</version> <version>8.0.30</version>
</dependency> </dependency>
<!-- <dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.faces</artifactId>
<version>${com.sun.faces.version}</version>
</dependency>-->
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId> <artifactId>junit-jupiter</artifactId>

View File

@ -206,8 +206,8 @@ public class RecipeDetailBean implements Serializable {
/** /**
* After construction and injection, we obtain the recipe ID * After construction and injection, we obtain the recipe ID
* passed to us, if any, and load the recipe. It's also stored * passed to us, if any and load the recipe. It's also stored
* in @see UserSession for the detail editor. * in @see UserSession for the detail editor and
* *
* @see PictureController. * @see PictureController.
*/ */
@ -720,8 +720,8 @@ public class RecipeDetailBean implements Serializable {
} }
if (recipeService.save(this.getRecipe())) { if (recipeService.save(this.getRecipe())) {
////////////userSession.setRecipe(null); userSession.setRecipe(null);
return "recipeDetails?faces-redirect=true"; return "recipeDetails";
} else { } else {
JSFUtils.addErrorMessage("Save recipe failed"); JSFUtils.addErrorMessage("Save recipe failed");
return null; return null;

View File

@ -136,6 +136,6 @@ public class SpringSecurityConfig {
"/recipeDetails.jsf", "/recipeDetails.jsf",
"/recipeDetails.xhtml", "/recipeDetails.xhtml",
"/shoppingList.jsf", "/shoppingList.jsf",
"/recipePrint.xhtml"); "/recipePrint.jsf");
} }
} }

View File

@ -62,12 +62,12 @@
<p:outputLabel for="@next" <p:outputLabel for="@next"
value="Title" value="Title"
/> />
<p:focus/>
<p:inputText id="rtitle" <p:inputText id="rtitle"
size="45" required="true" size="45" required="true"
placeholder="A recipe title is required." placeholder="A recipe title is required."
value="#{recipeDetailBean.recipe.title}" value="#{recipeDetailBean.recipe.title}"
> >
<p:focus />
<f:ajax execute="rtitle" <f:ajax execute="rtitle"
render="editorPanel" render="editorPanel"
/> />
@ -372,34 +372,28 @@
> >
<p:panel header="Instructions"> <p:panel header="Instructions">
<div id="insection"> <div id="insection">
<p:focus/>
<h:inputTextarea <h:inputTextarea
id="ctlInstructions" id="ctlInstructions"
rows="30" cols="120" rows="30" cols="120"
escape="false" escape="false"
value="#{recipeDetailBean.recipe.instructions}" value="#{recipeDetailBean.recipe.instructions}"
> />
<p:focus />
</h:inputTextarea>
</div> </div>
</p:panel> </p:panel>
</p:tab> </p:tab>
<p:tab id="notesTab" title="Notes"> <p:tab id="notesTab" title="Notes">
<p:panel header="Notes"> <p:panel header="Notes">
<p:focus/>
<h:inputTextarea id="ctlNotes" <h:inputTextarea id="ctlNotes"
rows="30" cols="120" rows="30" cols="120"
escape="false" escape="false"
value="#{recipeDetailBean.recipe.modifications}" value="#{recipeDetailBean.recipe.modifications}"
> />
<p:focus/>
</h:inputTextarea>
</p:panel> </p:panel>
</p:tab> </p:tab>
</p:tabView> </p:tabView>
<p:commandButton id="doSave" value="Save" <p:commandButton id="doSave" value="Save" icon="ui-icon-pencil" ajax="false" disabled="{not recipeDetailBean.dirty}" action="#{recipeDetailBean.doSave}" />
icon="ui-icon-pencil" ajax="false"
disabled="{not recipeDetailBean.dirty}"
action="#{recipeDetailBean.doSave}"
/>
<p:commandButton id="doCancel" value="Cancel" <p:commandButton id="doCancel" value="Cancel"
ajax="false" immediate="true" ajax="false" immediate="true"
action="recipeDetails.jsf" action="recipeDetails.jsf"

View File

@ -54,7 +54,7 @@
<p:commandButton ajax="false" <p:commandButton ajax="false"
value="Print" value="Print"
icon="ui-icon-print" icon="ui-icon-print"
action="recipePrint.jsf?faces-redirect=true" action="recipePrint.jsf"
styleClass="ui-button-print" styleClass="ui-button-print"
immediate="true" immediate="true"
/> />

View File

@ -50,7 +50,7 @@
/> />
</p:panelGrid> </p:panelGrid>
<!-- --> <!-- -->
<p:panelGrid id="ingredientsc" columns="1"> <p:panelGrid id="ingredientsc">
<f:facet name="header"> <f:facet name="header">
<h:outputText styleClass="subtitle" <h:outputText styleClass="subtitle"
value="Ingredients" value="Ingredients"
@ -61,7 +61,6 @@
showDirectLinksArrows="true" showDirectLinksArrows="true"
value="#{recipeDetailBean.ingredients}" value="#{recipeDetailBean.ingredients}"
var="ingredient" var="ingredient"
style="width: 100%"
> >
<p:column <p:column
style="text-align: right; width: 2em" style="text-align: right; width: 2em"
@ -101,7 +100,9 @@
</p:dataTable> </p:dataTable>
</p:column> </p:column>
</p:panelGrid> </p:panelGrid>
<!-- --> <h:outputText
value="Recipe ID: #{recipeDetailBean.recipe.id}"
/>
<p:panelGrid columns="1" style="width: 100%"> <p:panelGrid columns="1" style="width: 100%">
<f:facet name="header"> <f:facet name="header">
<h:outputText styleClass="subtitle" <h:outputText styleClass="subtitle"
@ -125,9 +126,6 @@
value="#{recipeDetailBean.modifications}" value="#{recipeDetailBean.modifications}"
/> />
</p:panelGrid> </p:panelGrid>
<h:outputText
value="Recipe ID: #{recipeDetailBean.recipe.id}"
/>
</h:form> </h:form>
</ui:define> </ui:define>
</ui:composition> </ui:composition>

View File

@ -42,7 +42,7 @@
<p:tab id="overviewTab" title="Shopping List"> <p:tab id="overviewTab" title="Shopping List">
<h:form id="form1"> <h:form id="form1">
<p:dataTable id="tblRecipes" <p:dataTable id="tblRecipes"
style="width: 60em" style="width: 40em"
value="#{shoppingListBean.recipeList}" value="#{shoppingListBean.recipeList}"
var="item" var="item"
> >
@ -87,7 +87,7 @@
> >
<p:dataTable id="tblShopIngredients" <p:dataTable id="tblShopIngredients"
value="#{shoppingListBean.ingredientList}" value="#{shoppingListBean.ingredientList}"
style="width: 60em;" style="width: 40em;"
sortBy="#{item.shopCat}" var="item" sortBy="#{item.shopCat}" var="item"
> >
<f:facet name="header"> <f:facet name="header">