<propertyfile file="${built-jar.properties}">
<entry key="${basedir}" value=""/>
</propertyfile>
+ <antcall target="-maybe-call-dep">
+ <param name="call.built.properties" value="${built-jar.properties}"/>
+ <param location="${project.jcore-ee-logger}" name="call.subproject"/>
+ <param location="${project.jcore-ee-logger}/build.xml" name="call.script"/>
+ <param name="call.target" value="jar"/>
+ <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
+ <param name="transfer.not.archive.disabled" value="true"/>
+ </antcall>
</target>
<target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
<target depends="init" name="-check-automatic-build">
<propertyfile file="${built-clean.properties}">
<entry key="${basedir}" value=""/>
</propertyfile>
+ <antcall target="-maybe-call-dep">
+ <param name="call.built.properties" value="${built-clean.properties}"/>
+ <param location="${project.jcore-ee-logger}" name="call.subproject"/>
+ <param location="${project.jcore-ee-logger}/build.xml" name="call.script"/>
+ <param name="call.target" value="clean"/>
+ <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
+ <param name="transfer.not.archive.disabled" value="true"/>
+ </antcall>
</target>
<target depends="init" name="-do-clean">
<delete dir="${build.dir}"/>
-build.xml.data.CRC32=622c8e1d
+build.xml.data.CRC32=bbffe842
build.xml.script.CRC32=fa35cacf
build.xml.stylesheet.CRC32=8064a381@1.75.2.48
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=622c8e1d
-nbproject/build-impl.xml.script.CRC32=40bf9247
+nbproject/build-impl.xml.data.CRC32=bbffe842
+nbproject/build-impl.xml.script.CRC32=a945b1d8
nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
-file.reference.jcore-ee-logger.jar=lib\\jcore-ee-logger.jar
file.reference.jcore.jar=lib/jcore.jar
-file.reference.jcoreee.jar=lib\\jcoreee.jar
+file.reference.jcoreee.jar=lib/jcoreee.jar
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=false
jar.index=${jnlp.enabled}
javac.classpath=\
${file.reference.jcore.jar}:\
- ${file.reference.jcore-ee-logger.jar}:\
+ ${reference.jcore-ee-logger.jar}:\
${file.reference.jcoreee.jar}
# Space-separated list of extra javac options
javac.compilerargs=-Xlint:unchecked -Xlint:deprecation
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=true
platform.active=default_platform
+project.jcore-ee-logger=../jcore-ee-logger
project.license=gpl30
+reference.jcore-ee-logger.jar=${project.jcore-ee-logger}/dist/jcore-ee-logger.jar
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
${javac.test.classpath}:\
${build.test.classes.dir}
source.encoding=UTF-8
-source.reference.jcore-ee-logger.jar=../jcore-ee-logger/src/
source.reference.jcore.jar=../jcore/src/
source.reference.jcoreee.jar=../jcoreee/src/
src.dir=src
<libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
<definitions>./lib/nblibraries.properties</definitions>
</libraries>
+ <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
+ <reference>
+ <foreign-project>jcore-ee-logger</foreign-project>
+ <artifact-type>jar</artifact-type>
+ <script>build.xml</script>
+ <target>jar</target>
+ <clean-target>clean</clean-target>
+ <id>jar</id>
+ </reference>
+ </references>
</configuration>
</project>
--- /dev/null
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jshopcore.model.basket;
+
+import java.io.Serializable;
+import org.mxchange.jshopcore.model.product.Product;
+
+/**
+ * An interface for addable basket items
+ *
+ * @author Roland Haeder
+ */
+public interface AddableBasketItem extends Serializable {
+
+ /**
+ * Item amount
+ *
+ * @return the amount
+ */
+ public Long getAmount ();
+
+ /**
+ * Item amount
+ *
+ * @param amount the amount to set
+ */
+ public void setAmount (final Long amount);
+
+ /**
+ * Entry id (from database backend)
+ *
+ * @return the id
+ */
+ public Long getId ();
+
+ /**
+ * Entry id (from database backend)
+ *
+ * @param id the id to set
+ */
+ public void setId (final Long id);
+
+ /**
+ * @return the id
+ */
+ public Long getItemId ();
+
+ /**
+ * @param id the id to set
+ */
+ public void setItemId (final Long id);
+
+ /**
+ * @return the type
+ */
+ public String getItemType ();
+
+ /**
+ * @param type the type to set
+ */
+ public void setItemType (final String type);
+
+ /**
+ * @return the product
+ */
+ public Product getProduct ();
+
+ /**
+ * Product instance
+ *
+ * @param product the product to set
+ */
+ public void setProduct (final Product product);
+}
import java.sql.SQLException;
import java.text.MessageFormat;
import java.util.Map;
-import org.mxchange.jcoree.BaseEeSystem;
-import org.mxchange.jshopcore.model.item.AddableBasketItem;
+import org.mxchange.jcoreee.BaseEeSystem;
/**
* A general basket class
import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.Map;
-import org.mxchange.jshopcore.model.item.AddableBasketItem;
/**
* An interface for baskets
--- /dev/null
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jshopcore.model.basket;
+
+import java.sql.SQLException;
+import org.mxchange.jshopcore.model.basket.BaseBasket;
+import org.mxchange.jshopcore.model.basket.Basket;
+import org.mxchange.jshopcore.model.basket.AddableBasketItem;
+
+/**
+ * A basket for orderable items
+ *
+ * @author Roland Haeder
+ */
+public class ShopBasket extends BaseBasket<AddableBasketItem> implements Basket<AddableBasketItem> {
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 4_384_123_923_163_957L;
+
+ /**
+ * Default constructor to be able to throw exceptions from super constructor
+ * @throws java.sql.SQLException If an SQL error occurs
+ */
+ public ShopBasket () throws SQLException {
+ // Call super constructor
+ super();
+ }
+}
+++ /dev/null
-/*
- * Copyright (C) 2015 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.model.basket.item;
-
-import java.sql.SQLException;
-import org.mxchange.jshopcore.model.basket.BaseBasket;
-import org.mxchange.jshopcore.model.basket.Basket;
-import org.mxchange.jshopcore.model.item.AddableBasketItem;
-
-/**
- * A basket for orderable items
- *
- * @author Roland Haeder
- */
-public class ItemBasket extends BaseBasket<AddableBasketItem> implements Basket<AddableBasketItem> {
- /**
- * Serial number
- */
- private static final long serialVersionUID = 4_384_123_923_163_957L;
-
- /**
- * Default constructor to be able to throw exceptions from super constructor
- * @throws java.sql.SQLException If an SQL error occurs
- */
- public ItemBasket () throws SQLException {
- // Call super constructor
- super();
- }
-}
*/
package org.mxchange.jshopcore.model.category;
-import java.io.UnsupportedEncodingException;
import java.text.MessageFormat;
import java.util.Objects;
-import org.mxchange.jcoree.BaseEeSystem;
+import org.mxchange.jcoreee.BaseEeSystem;
/**
* A general product category class
return 1;
}
- /**
- * Decodes the UTF8-encoded title
- *
- * @return Decoded title
- */
- @Override
- public String getDecodedTitle () throws UnsupportedEncodingException {
- // Get title
- byte[] t = this.getTitle().getBytes();
-
- // Decode it
- return new String(t, "UTF-8"); //NOI18N
- }
-
/**
* Id number of category
*
package org.mxchange.jshopcore.model.category;
import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
/**
* An interface for categories
*/
@Override
public int compareTo (final Category category);
-
- /**
- * Decodes the UTF8-encoded title
- *
- * @return Decoded title
- * @throws java.io.UnsupportedEncodingException If the encoding UTF-8 is not supported
- */
- public String getDecodedTitle () throws UnsupportedEncodingException ;
}
--- /dev/null
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jshopcore.model.category;
+
+import org.mxchange.jshopcore.model.category.BaseCategory;
+import org.mxchange.jshopcore.model.category.BaseCategory;
+
+/**
+ * A product category
+ * @author Roland Haeder
+ */
+public class ProductCategory extends BaseCategory {
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 21_458_945_712_659L;
+
+ /**
+ * Constructor which accepts all database fields
+ * @param id Id number of database record
+ * @param title Category title
+ * @param parent Parent id
+ */
+ public ProductCategory (final Long id, final String title, final Long parent) {
+ // Call parent constructor
+ super(id, title, parent);
+ }
+
+ /**
+ * Default constructor
+ */
+ public ProductCategory () {
+ }
+}
+++ /dev/null
-/*
- * Copyright (C) 2015 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.model.category.product;
-
-import org.mxchange.jshopcore.model.category.BaseCategory;
-
-/**
- * A product category
- * @author Roland Haeder
- */
-public class ProductCategory extends BaseCategory {
- /**
- * Serial number
- */
- private static final long serialVersionUID = 21_458_945_712_659L;
-
- /**
- * Constructor which accepts all database fields
- * @param id Id number of database record
- * @param title Category title
- * @param parent Parent id
- */
- public ProductCategory (final Long id, final String title, final Long parent) {
- // Call parent constructor
- super(id, title, parent);
- }
-
- /**
- * Default constructor
- */
- public ProductCategory () {
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2015 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.model.item;
-
-import java.io.Serializable;
-import org.mxchange.jshopcore.model.product.Product;
-
-/**
- * An interface for addable basket items
- *
- * @author Roland Haeder
- */
-public interface AddableBasketItem extends Serializable {
-
- /**
- * Item amount
- * @return the amount
- */
- public Long getAmount ();
-
- /**
- * Item amount
- * @param amount the amount to set
- */
- public void setAmount (final Long amount);
-
- /**
- * Entry id (from database backend)
- * @return the id
- */
- public Long getId ();
-
- /**
- * Entry id (from database backend)
- * @param id the id to set
- */
- public void setId (final Long id);
-
- /**
- * @return the id
- */
- public Long getItemId ();
-
- /**
- * @param id the id to set
- */
- public void setItemId (final Long id);
-
- /**
- * @return the type
- */
- public String getItemType ();
-
- /**
- * @param type the type to set
- */
- public void setItemType (final String type);
-
- /**
- * Calculates total price by multipying amount and single price
- *
- * @return Total price of this item
- */
- public Float calculateTotalPrice ();
-
- /**
- * @return the product
- */
- public Product getProduct ();
-
- /**
- * @param product the product to set
- */
- public void setProduct (final Product product);
-}
import java.text.MessageFormat;
import java.util.Objects;
-import org.mxchange.jcoree.BaseEeSystem;
+import org.mxchange.jcoreee.BaseEeSystem;
+import org.mxchange.jshopcore.model.basket.AddableBasketItem;
import org.mxchange.jshopcore.model.product.Product;
/**
*/
private Product product;
- @Override
- public Float calculateTotalPrice () {
- // product should be set
- if (this.getProduct() == null) {
- // Abort here
- throw new NullPointerException("product is null"); //NOI18N
- }
-
- // Calculate and return it
- // TODO: If later other purchaseable items (other than products) are handled through this class, this needs expansion
- return (this.getAmount() * this.getProduct().getPrice());
- }
-
@Override
public int compareTo (final AddableBasketItem item) {
// Trace message
--- /dev/null
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jshopcore.model.item;
+
+import java.text.MessageFormat;
+import org.mxchange.jshopcore.model.basket.AddableBasketItem;
+import org.mxchange.jshopcore.model.product.Product;
+
+/**
+ * A general basket item
+ *
+ * @author Roland Haeder
+ */
+public class BasketItem extends BaseItem implements AddableBasketItem {
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 52_749_158_492_581_578L;
+
+ /**
+ * Default constructor
+ */
+ public BasketItem () {
+ }
+
+ /**
+ * Constructor for an item from given Product instance
+ *
+ * @param product Product instance
+ */
+ public BasketItem (final Product product) {
+ // Call default constructor
+ this();
+
+ // Trace message
+ this.getLogger().logDebug(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N
+
+ // product must not be null
+ if (null == product) {
+ // Abort here
+ throw new NullPointerException("product is null"); //NOI18N
+ }
+
+ // Copy all neccessary values
+ this.setItemId(product.getItemId());
+ this.setItemType("Product"); //NOI18N
+ }
+}
+++ /dev/null
-/*
- * Copyright (C) 2015 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.model.item.basket;
-
-import java.text.MessageFormat;
-import org.mxchange.jshopcore.model.item.AddableBasketItem;
-import org.mxchange.jshopcore.model.item.BaseItem;
-import org.mxchange.jshopcore.model.product.Product;
-
-/**
- * A general basket item
- *
- * @author Roland Haeder
- */
-public class BasketItem extends BaseItem implements AddableBasketItem {
- /**
- * Serial number
- */
- private static final long serialVersionUID = 52_749_158_492_581_578L;
-
- /**
- * Default constructor
- */
- public BasketItem () {
- }
-
- /**
- * Constructor for an item from given Product instance
- *
- * @param product Product instance
- */
- public BasketItem (final Product product) {
- // Call default constructor
- this();
-
- // Trace message
- this.getLogger().logDebug(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N
-
- // product must not be null
- if (null == product) {
- // Abort here
- throw new NullPointerException("product is null"); //NOI18N
- }
-
- // Copy all neccessary values
- this.setItemId(product.getItemId());
- this.setItemType("Product"); //NOI18N
- }
-}
import java.text.MessageFormat;
import java.util.Objects;
-import org.mxchange.jcoree.BaseEeSystem;
+import org.mxchange.jcoreee.BaseEeSystem;
/**
* A general product class
--- /dev/null
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jshopcore.model.product;
+
+import java.text.MessageFormat;
+import org.mxchange.jshopcore.model.product.BaseProduct;
+import org.mxchange.jshopcore.model.product.BaseProduct;
+import org.mxchange.jshopcore.model.product.Product;
+import org.mxchange.jshopcore.model.product.Product;
+
+/**
+ * Generic product class
+ *
+ * @author Roland Haeder
+ * TODO: Find a better name
+ */
+public class GenericProduct extends BaseProduct implements Product {
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 54_578_571_769_283L;
+
+ /**
+ * Default constructor
+ */
+ public GenericProduct () {
+ }
+
+ /**
+ * Constructor will all required data
+ *
+ * @param id Id number of product
+ * @param title Name of product
+ * @param price Price
+ * @param categoryId Category id
+ * @param available Availability (selectable by customer)
+ */
+ public GenericProduct (final Long id, final String title, final Float price, final Long categoryId, final Boolean available) {
+ // Trace message
+ this.getLogger().logTrace(MessageFormat.format("id={0},title={1},price={2},categoryId={3},available={4} - CALLED!", id, title, price, categoryId, available)); //NOI18N
+
+ // Set all here
+ this.setItemId(id);
+ this.setTitle(title);
+ this.setPrice(price);
+ this.setCategoryId(categoryId);
+ this.setAvailable(available);
+ }
+}
+++ /dev/null
-/*
- * Copyright (C) 2015 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.model.product.generic;
-
-import java.text.MessageFormat;
-import org.mxchange.jshopcore.model.product.BaseProduct;
-import org.mxchange.jshopcore.model.product.Product;
-
-/**
- * Generic product class
- *
- * @author Roland Haeder
- * TODO: Find a better name
- */
-public class GenericProduct extends BaseProduct implements Product {
- /**
- * Serial number
- */
- private static final long serialVersionUID = 54_578_571_769_283L;
-
- /**
- * Default constructor
- */
- public GenericProduct () {
- }
-
- /**
- * Constructor will all required data
- *
- * @param id Id number of product
- * @param title Name of product
- * @param price Price
- * @param categoryId Category id
- * @param available Availability (selectable by customer)
- */
- public GenericProduct (final Long id, final String title, final Float price, final Long categoryId, final Boolean available) {
- // Trace message
- this.getLogger().logTrace(MessageFormat.format("id={0},title={1},price={2},categoryId={3},available={4} - CALLED!", id, title, price, categoryId, available)); //NOI18N
-
- // Set all here
- this.setItemId(id);
- this.setTitle(title);
- this.setPrice(price);
- this.setCategoryId(categoryId);
- this.setAvailable(available);
- }
-}