// Get all fields
String title = request.getParameter(CategoryFrontend.COLUMN_TITLE);
- String parent = request.getParameter(CategoryFrontend.COLUMN_PARENT);
+ String parentId = request.getParameter(CategoryFrontend.COLUMN_PARENT);
// Debug message
- this.getLogger().debug(MessageFormat.format("title={0},parent={1}", title, parent)); //NOI18N
+ this.getLogger().debug(MessageFormat.format("title={0},parentId={1}", title, parentId)); //NOI18N
// Init variables for casting
Integer id = 0;
} else if (title.isEmpty()) {
// Is left empty
throw new IllegalArgumentException(MessageFormat.format("{0} is empty.", CategoryFrontend.COLUMN_TITLE)); //NOI18N
- } else if ((parent != null) && (!parent.isEmpty())) {
+ } else if ((parentId != null) && (!parentId.isEmpty())) {
// "parent" is set, so check it
try {
- id = Integer.parseInt(parent);
+ id = Integer.parseInt(parentId);
} catch (final NumberFormatException e) {
// Not valid number
throw new IllegalArgumentException(e);
// Get title, price and category id
String title = request.getParameter(ProductFrontend.COLUMN_TITLE);
String price = request.getParameter(ProductFrontend.COLUMN_PRICE);
- String category = request.getParameter(ProductFrontend.COLUMN_CATEGORY);
+ String categoryId = request.getParameter(ProductFrontend.COLUMN_CATEGORY);
String available = request.getParameter(ProductFrontend.COLUMN_AVAILABLE);
// Debug message
- this.getLogger().debug(MessageFormat.format("title={0},price={1},category={2},available={3}", title, price, category, available)); //NOI18N
+ this.getLogger().debug(MessageFormat.format("title={0},price={1},categoryId={2},available={3}", title, price, categoryId, available)); //NOI18N
// Variables for converting
Long id = null;
} else if (price.isEmpty()) {
// Is left empty
throw new IllegalArgumentException(MessageFormat.format("{0} is empty.", ProductFrontend.COLUMN_PRICE)); //NOI18N
- } else if (null == category) {
+ } else if (null == categoryId) {
// "title" not set
throw new IllegalArgumentException(MessageFormat.format("{0} is not set.", ProductFrontend.COLUMN_CATEGORY)); //NOI18N
- } else if (category.isEmpty()) {
+ } else if (categoryId.isEmpty()) {
// Is left empty
throw new IllegalArgumentException(MessageFormat.format("{0} is empty.", ProductFrontend.COLUMN_CATEGORY)); //NOI18N
} else if (null == available) {
// Parse numbers
try {
- id = Long.parseLong(category);
+ id = Long.parseLong(categoryId);
p = Float.parseFloat(price);
} catch (final NumberFormatException e) {
// Not valid number
@Override
public String generateLinkForParent (final Category category) {
// Trace message
- this.getLogger().trace(MessageFormat.format("category={0} - CALLED!", category)); //NOI18N
+ this.getLogger().trace(MessageFormat.format("categoryId={0} - CALLED!", category)); //NOI18N
// category must not be null
if (null == category) {
}
// Get parent id
- Long parent = category.getParent();
+ Long parentId = category.getParentId();
// Is the id set?
- if (parent > 0) {
+ if (parentId > 0) {
// Product HTML code for link
- throw new UnsupportedOperationException(MessageFormat.format("parent={0} - Unfinished!", parent)); //NOI18N
+ throw new UnsupportedOperationException(MessageFormat.format("parentId={0} - Unfinished!", parentId)); //NOI18N
}
// No parent set
}
// Debug message
- this.getLogger().debug(MessageFormat.format("category={0}", category)); //NOI18N
+ this.getLogger().debug(MessageFormat.format("categoryId={0}", category)); //NOI18N
String title = null;
try {