re-activated category suggestions
This commit is contained in:
parent
3b0342429f
commit
c051751e10
|
@ -31,13 +31,4 @@ public interface RecipeRepository
|
|||
|
||||
@Query(name = "Recipe.findCusines", nativeQuery = true)
|
||||
List<String> FindCuisinesNative();
|
||||
|
||||
|
||||
// final static String SQL_FIND_CATEGORIES =
|
||||
// "SELECT DISTINCT category from categories"
|
||||
// + " where category is not null and category <> ''"
|
||||
// + " ORDER BY category ASC";
|
||||
//
|
||||
// @Query(value = SQL_FIND_CATEGORIES, nativeQuery = true)
|
||||
// public List<String> findDistinctCategoryNative();
|
||||
}
|
||||
|
|
|
@ -41,7 +41,8 @@ public class RecipeService implements Serializable {
|
|||
}
|
||||
|
||||
public List<Recipe> findByTitle(String searchText) {
|
||||
return recipeRepository.findByTitleContaining(searchText);
|
||||
return recipeRepository
|
||||
.findByTitleContaining(searchText);
|
||||
}
|
||||
|
||||
public Recipe findByPrimaryKey(Long recipeId) {
|
||||
|
@ -52,12 +53,11 @@ public class RecipeService implements Serializable {
|
|||
return recipeRepository.findDetailsById(recipeId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* final String sql = "SELECT DISTINCT cuisine from recipe"
|
||||
+ " where cuisine is not null and cuisine <> ''"
|
||||
+ " ORDER BY cuisine ASC";
|
||||
* final String sql = "SELECT DISTINCT cuisine from recipe" +
|
||||
* " where cuisine is not null and cuisine <> ''" + " ORDER
|
||||
* BY cuisine ASC";
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
||||
|
@ -65,7 +65,6 @@ public class RecipeService implements Serializable {
|
|||
return recipeRepository.FindCuisinesNative();
|
||||
}
|
||||
|
||||
|
||||
public void save(Recipe recipe) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
@ -81,16 +80,15 @@ public class RecipeService implements Serializable {
|
|||
return null;
|
||||
}
|
||||
|
||||
public List<String> findCategories() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
@Inject
|
||||
CategoryRepository categoryRepository;
|
||||
|
||||
// /**
|
||||
// *
|
||||
// * @return All Category names that are not null/blank, sorted.
|
||||
// */
|
||||
// public List<String> findCategoryNames() {
|
||||
// return categoryRepository.findDistinctCategoryNative();
|
||||
// }
|
||||
/**
|
||||
*
|
||||
* @return All Category names that are not null/blank,
|
||||
* sorted.
|
||||
*/
|
||||
public List<String> findCategories() {
|
||||
return categoryRepository.findDistinctCategoryNative();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,13 +53,15 @@
|
|||
label="Category"
|
||||
value="#{recipeDetailBean.category}"
|
||||
tip="One or more categories, separated by commas (ex: Entree, Soup)"
|
||||
/>
|
||||
<p:commandButton
|
||||
value="<- Suggest"
|
||||
>
|
||||
<f:ajax execute="rcategory"
|
||||
<f:ajax execute="rcategory bxCat"
|
||||
listener="#{recipeDetailBean.ajaxSuggestCategory}"
|
||||
render="rcategory"
|
||||
/>
|
||||
</p:inputText>
|
||||
<p:button value="<- Suggest">
|
||||
</p:button>
|
||||
</p:commandButton>
|
||||
<p:selectOneMenu id="bxCat"
|
||||
value="#{recipeDetailBean.catToAdd}"
|
||||
tip="Recipe category suggestions, based on previous selections"
|
||||
|
@ -200,7 +202,8 @@
|
|||
<p:column label="Amt"
|
||||
style="width: 4em"
|
||||
>
|
||||
<p:inputText id="ingAmt" size="5"
|
||||
<p:inputText id="ingAmt"
|
||||
size="5"
|
||||
value="#{item.displayAmount}"
|
||||
style="text-align: right"
|
||||
rendered="#{not item.ingGroup}"
|
||||
|
@ -211,13 +214,17 @@
|
|||
style="width: 7em"
|
||||
>
|
||||
<p:inputText id="ingUnit"
|
||||
value="#{item.unit}" size="10"
|
||||
value="#{item.unit}"
|
||||
size="10"
|
||||
rendered="#{not item.ingGroup}"
|
||||
>
|
||||
</p:inputText>
|
||||
</p:column>
|
||||
<p:column label="Item" style="width: 22em">
|
||||
<p:inputText id="ingItem" size="35"
|
||||
<p:column label="Item"
|
||||
style="width: 22em"
|
||||
>
|
||||
<p:inputText id="ingItem"
|
||||
size="35"
|
||||
value="#{item.item}"
|
||||
>
|
||||
</p:inputText>
|
||||
|
@ -234,7 +241,8 @@
|
|||
</p:column>
|
||||
<p:column label="Key">
|
||||
<p:inputText id="ingKey"
|
||||
value="#{item.ingkey}" size="20"
|
||||
value="#{item.ingkey}"
|
||||
size="20"
|
||||
rendered="#{not item.ingGroup}"
|
||||
/>
|
||||
</p:column>
|
||||
|
|
Loading…
Reference in New Issue
Block a user