repo_name
stringlengths
7
104
file_path
stringlengths
13
198
context
stringlengths
67
7.15k
import_statement
stringlengths
16
4.43k
code
stringlengths
40
6.98k
prompt
stringlengths
227
8.27k
next_line
stringlengths
8
795
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java
// Path: src/main/java/eu/cloudscale/showcase/db/model/IAuthor.java // public interface IAuthor // { // // public Integer getAId(); // // public void setAId(Integer AId); // // public String getAFname(); // // public void setAFname(String AFname); // // public String getALname(); // // public void setALname(String ALname); // // public String getAMname(); // // public void setAMname(String AMname); // // public Date getADob(); // // public void setADob(Date ADob); // // public String getABio(); // // public void setABio(String ABio); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IItem.java // public interface IItem // { // // public Integer getIId(); // // public void setIDimension(String IDimension); // // public String getIDimension(); // // public void setIBacking(String IBacking); // // public String getIBacking(); // // public void setIPage(String IPage); // // public String getIPage(); // // public void setIIsbn(String IIsbn); // // public String getIIsbn(); // // public void setIStock(Integer IStock); // // public Integer getIStock(); // // public void setIAvail(Date IAvail); // // public Date getIAvail(); // // public void setICost(Double i_COST); // // public Double getICost(); // // public void setISrp(Double i_SRP); // // public Double getISrp(); // // public void setIImage(String IImage); // // public String getIImage(); // // public void setIThumbnail(String IThumbnail); // // public String getIThumbnail(); // // public void setIRelated5(Integer IRelated5); // // public Integer getIRelated5(); // // public void setIRelated4(Integer IRelated4); // // public Integer getIRelated4(); // // public void setIRelated3(Integer IRelated3); // // public Integer getIRelated3(); // // public void setIRelated2(Integer IRelated2); // // public Integer getIRelated2(); // // public void setIRelated1(Integer IRelated1); // // public Integer getIRelated1(); // // public void setIDesc(String IDesc); // // public String getIDesc(); // // public void setISubject(String ISubject); // // public String getISubject(); // // public void setIPublisher(String IPublisher); // // public String getIPublisher(); // // public void setIPubDate(Date IPubDate); // // public Date getIPubDate(); // // public void setITitle(String ITitle); // // public String getITitle(); // // public void setAuthor(IAuthor author); // // public IAuthor getAuthor(); // // public void setIId(Integer IId); // // public double getIRandom(); // // public void setIRandom(double num); // }
import java.util.List; import eu.cloudscale.showcase.db.model.IAuthor; import eu.cloudscale.showcase.db.model.IItem;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.dao; public interface IItemDao extends IDao<IItem> { public List<IItem> findAll(); public IItem findById(int id); public List<IItem> getPromotional(); public List<IItem> getNewProducts(String category); public List<Object[]> getBestSellers(String category); public IItem getRandomItem(); public IItem getObject();
// Path: src/main/java/eu/cloudscale/showcase/db/model/IAuthor.java // public interface IAuthor // { // // public Integer getAId(); // // public void setAId(Integer AId); // // public String getAFname(); // // public void setAFname(String AFname); // // public String getALname(); // // public void setALname(String ALname); // // public String getAMname(); // // public void setAMname(String AMname); // // public Date getADob(); // // public void setADob(Date ADob); // // public String getABio(); // // public void setABio(String ABio); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IItem.java // public interface IItem // { // // public Integer getIId(); // // public void setIDimension(String IDimension); // // public String getIDimension(); // // public void setIBacking(String IBacking); // // public String getIBacking(); // // public void setIPage(String IPage); // // public String getIPage(); // // public void setIIsbn(String IIsbn); // // public String getIIsbn(); // // public void setIStock(Integer IStock); // // public Integer getIStock(); // // public void setIAvail(Date IAvail); // // public Date getIAvail(); // // public void setICost(Double i_COST); // // public Double getICost(); // // public void setISrp(Double i_SRP); // // public Double getISrp(); // // public void setIImage(String IImage); // // public String getIImage(); // // public void setIThumbnail(String IThumbnail); // // public String getIThumbnail(); // // public void setIRelated5(Integer IRelated5); // // public Integer getIRelated5(); // // public void setIRelated4(Integer IRelated4); // // public Integer getIRelated4(); // // public void setIRelated3(Integer IRelated3); // // public Integer getIRelated3(); // // public void setIRelated2(Integer IRelated2); // // public Integer getIRelated2(); // // public void setIRelated1(Integer IRelated1); // // public Integer getIRelated1(); // // public void setIDesc(String IDesc); // // public String getIDesc(); // // public void setISubject(String ISubject); // // public String getISubject(); // // public void setIPublisher(String IPublisher); // // public String getIPublisher(); // // public void setIPubDate(Date IPubDate); // // public Date getIPubDate(); // // public void setITitle(String ITitle); // // public String getITitle(); // // public void setAuthor(IAuthor author); // // public IAuthor getAuthor(); // // public void setIId(Integer IId); // // public double getIRandom(); // // public void setIRandom(double num); // } // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java import java.util.List; import eu.cloudscale.showcase.db.model.IAuthor; import eu.cloudscale.showcase.db.model.IItem; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.dao; public interface IItemDao extends IDao<IItem> { public List<IItem> findAll(); public IItem findById(int id); public List<IItem> getPromotional(); public List<IItem> getNewProducts(String category); public List<Object[]> getBestSellers(String category); public IItem getRandomItem(); public IItem getObject();
public List<IItem> findAllByAuthor(IAuthor author);
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/servlets/PaymentController.java
// Path: src/main/java/eu/cloudscale/showcase/db/BuyConfirmResult.java // public class BuyConfirmResult // { // public IOrders order; // public IShoppingCart cart; // // public BuyConfirmResult(IOrders order2, IShoppingCart sc) // { // order = order2; // cart = sc; // } // // // public IOrders getOrder() // { // return order; // } // // // public void setOrder(IOrders order) // { // this.order = order; // } // // // public IShoppingCart getCart() // { // return cart; // } // // // public void setCart(IShoppingCart cart) // { // this.cart = cart; // } // // } // // Path: src/main/java/eu/cloudscale/showcase/servlets/helpers/PaymentService.java // @Service("paymentService") // public class PaymentService{ // public static final String BASE_URL = "https://arcane-meadow-6418.herokuapp.com/"; // // @Async // public Future<String> callPaymentService(String distribution, String attr1, String attr2, String attr3) // { // try { // ExecutorService executor = Executors.newFixedThreadPool(1); // String url = this.getUrl(distribution, attr1, attr2, attr3); // Future<Response> response = executor.submit(new Request(new URL(url))); // InputStream input = response.get().getBody(); // executor.shutdown(); // // String body = IOUtils.toString(input, "UTF-8"); // return new AsyncResult<String>(body); // } catch (MalformedURLException e) { // e.printStackTrace(); // } // catch (InterruptedException e) { // e.printStackTrace(); // } // catch (ExecutionException e) { // e.printStackTrace(); // } catch (IOException e) { // e.printStackTrace(); // } // return null; // } // // private String getUrl(String distribution, String attr1, String attr2, String attr3) // { // String url = ""; // if (distribution.equals("gauss")) { // url = "?mu=" + attr1 + "&sigma=" + attr2 + "&k=0"; // } // if (distribution.equals("expo")) { // url = "?lambda=" + attr1 + "&k=" + attr3; // } // if (distribution.equals("gamma")) { // url = "?alpha=" + attr1 + "&beta=" + attr2 + "&k=" + attr3; // } // if (distribution.equals("log")) { // url = "?mu=" + attr1 + "&sigma=" + attr2 + "&k=" + attr3; // } // if (distribution.equals("pareto")) { // url = "?alpha=" + attr1 + "&k=" + attr3; // } // if (distribution.equals("weibull")) { // url = "?alpha=" + attr1 + "&beta=" + attr2 + "&k=" + attr3; // } // if (distribution.equals("uniform")){ // url = "?a=" + attr1 + "&b=" + attr2; // } // if (distribution.equals("constant")) // { // url = "?c=" + attr1; // } // return BASE_URL + distribution + url + "&test=false"; // } // }
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.concurrent.Future; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import eu.cloudscale.showcase.db.BuyConfirmResult; import eu.cloudscale.showcase.servlets.helpers.PaymentService;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.servlets; @Controller @RequestMapping( "/payment" ) public class PaymentController extends AController { @Autowired @Qualifier("paymentService")
// Path: src/main/java/eu/cloudscale/showcase/db/BuyConfirmResult.java // public class BuyConfirmResult // { // public IOrders order; // public IShoppingCart cart; // // public BuyConfirmResult(IOrders order2, IShoppingCart sc) // { // order = order2; // cart = sc; // } // // // public IOrders getOrder() // { // return order; // } // // // public void setOrder(IOrders order) // { // this.order = order; // } // // // public IShoppingCart getCart() // { // return cart; // } // // // public void setCart(IShoppingCart cart) // { // this.cart = cart; // } // // } // // Path: src/main/java/eu/cloudscale/showcase/servlets/helpers/PaymentService.java // @Service("paymentService") // public class PaymentService{ // public static final String BASE_URL = "https://arcane-meadow-6418.herokuapp.com/"; // // @Async // public Future<String> callPaymentService(String distribution, String attr1, String attr2, String attr3) // { // try { // ExecutorService executor = Executors.newFixedThreadPool(1); // String url = this.getUrl(distribution, attr1, attr2, attr3); // Future<Response> response = executor.submit(new Request(new URL(url))); // InputStream input = response.get().getBody(); // executor.shutdown(); // // String body = IOUtils.toString(input, "UTF-8"); // return new AsyncResult<String>(body); // } catch (MalformedURLException e) { // e.printStackTrace(); // } // catch (InterruptedException e) { // e.printStackTrace(); // } // catch (ExecutionException e) { // e.printStackTrace(); // } catch (IOException e) { // e.printStackTrace(); // } // return null; // } // // private String getUrl(String distribution, String attr1, String attr2, String attr3) // { // String url = ""; // if (distribution.equals("gauss")) { // url = "?mu=" + attr1 + "&sigma=" + attr2 + "&k=0"; // } // if (distribution.equals("expo")) { // url = "?lambda=" + attr1 + "&k=" + attr3; // } // if (distribution.equals("gamma")) { // url = "?alpha=" + attr1 + "&beta=" + attr2 + "&k=" + attr3; // } // if (distribution.equals("log")) { // url = "?mu=" + attr1 + "&sigma=" + attr2 + "&k=" + attr3; // } // if (distribution.equals("pareto")) { // url = "?alpha=" + attr1 + "&k=" + attr3; // } // if (distribution.equals("weibull")) { // url = "?alpha=" + attr1 + "&beta=" + attr2 + "&k=" + attr3; // } // if (distribution.equals("uniform")){ // url = "?a=" + attr1 + "&b=" + attr2; // } // if (distribution.equals("constant")) // { // url = "?c=" + attr1; // } // return BASE_URL + distribution + url + "&test=false"; // } // } // Path: src/main/java/eu/cloudscale/showcase/servlets/PaymentController.java import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.concurrent.Future; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import eu.cloudscale.showcase.db.BuyConfirmResult; import eu.cloudscale.showcase.servlets.helpers.PaymentService; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.servlets; @Controller @RequestMapping( "/payment" ) public class PaymentController extends AController { @Autowired @Qualifier("paymentService")
PaymentService paymentService;
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/servlets/PaymentController.java
// Path: src/main/java/eu/cloudscale/showcase/db/BuyConfirmResult.java // public class BuyConfirmResult // { // public IOrders order; // public IShoppingCart cart; // // public BuyConfirmResult(IOrders order2, IShoppingCart sc) // { // order = order2; // cart = sc; // } // // // public IOrders getOrder() // { // return order; // } // // // public void setOrder(IOrders order) // { // this.order = order; // } // // // public IShoppingCart getCart() // { // return cart; // } // // // public void setCart(IShoppingCart cart) // { // this.cart = cart; // } // // } // // Path: src/main/java/eu/cloudscale/showcase/servlets/helpers/PaymentService.java // @Service("paymentService") // public class PaymentService{ // public static final String BASE_URL = "https://arcane-meadow-6418.herokuapp.com/"; // // @Async // public Future<String> callPaymentService(String distribution, String attr1, String attr2, String attr3) // { // try { // ExecutorService executor = Executors.newFixedThreadPool(1); // String url = this.getUrl(distribution, attr1, attr2, attr3); // Future<Response> response = executor.submit(new Request(new URL(url))); // InputStream input = response.get().getBody(); // executor.shutdown(); // // String body = IOUtils.toString(input, "UTF-8"); // return new AsyncResult<String>(body); // } catch (MalformedURLException e) { // e.printStackTrace(); // } // catch (InterruptedException e) { // e.printStackTrace(); // } // catch (ExecutionException e) { // e.printStackTrace(); // } catch (IOException e) { // e.printStackTrace(); // } // return null; // } // // private String getUrl(String distribution, String attr1, String attr2, String attr3) // { // String url = ""; // if (distribution.equals("gauss")) { // url = "?mu=" + attr1 + "&sigma=" + attr2 + "&k=0"; // } // if (distribution.equals("expo")) { // url = "?lambda=" + attr1 + "&k=" + attr3; // } // if (distribution.equals("gamma")) { // url = "?alpha=" + attr1 + "&beta=" + attr2 + "&k=" + attr3; // } // if (distribution.equals("log")) { // url = "?mu=" + attr1 + "&sigma=" + attr2 + "&k=" + attr3; // } // if (distribution.equals("pareto")) { // url = "?alpha=" + attr1 + "&k=" + attr3; // } // if (distribution.equals("weibull")) { // url = "?alpha=" + attr1 + "&beta=" + attr2 + "&k=" + attr3; // } // if (distribution.equals("uniform")){ // url = "?a=" + attr1 + "&b=" + attr2; // } // if (distribution.equals("constant")) // { // url = "?c=" + attr1; // } // return BASE_URL + distribution + url + "&test=false"; // } // }
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.concurrent.Future; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import eu.cloudscale.showcase.db.BuyConfirmResult; import eu.cloudscale.showcase.servlets.helpers.PaymentService;
} String customerIdString = request.getParameter( "C_ID" ); Integer customerId = null; if( customerIdString != null && !customerIdString.isEmpty() ) { customerId = Integer.parseInt( customerIdString ); } String ccType = request.getParameter( "CC_TYPE" ); String ccNumber_str = request.getParameter( "CC_NUMBER" ); Long ccNumber = null; if( !ccNumber_str.isEmpty() ) ccNumber = Long.parseLong( ccNumber_str ); SimpleDateFormat sdf = new SimpleDateFormat("mm/dd/yyyy"); String ccName = request.getParameter( "CC_NAME" ); Date ccExpiry = null; try { ccExpiry = sdf.parse(request.getParameter( "CC_EXPIRY" )); } catch ( ParseException e ) { e.printStackTrace(); } String shipping = request.getParameter( "SHIPPING" ); String street1 = request.getParameter( "street1" );
// Path: src/main/java/eu/cloudscale/showcase/db/BuyConfirmResult.java // public class BuyConfirmResult // { // public IOrders order; // public IShoppingCart cart; // // public BuyConfirmResult(IOrders order2, IShoppingCart sc) // { // order = order2; // cart = sc; // } // // // public IOrders getOrder() // { // return order; // } // // // public void setOrder(IOrders order) // { // this.order = order; // } // // // public IShoppingCart getCart() // { // return cart; // } // // // public void setCart(IShoppingCart cart) // { // this.cart = cart; // } // // } // // Path: src/main/java/eu/cloudscale/showcase/servlets/helpers/PaymentService.java // @Service("paymentService") // public class PaymentService{ // public static final String BASE_URL = "https://arcane-meadow-6418.herokuapp.com/"; // // @Async // public Future<String> callPaymentService(String distribution, String attr1, String attr2, String attr3) // { // try { // ExecutorService executor = Executors.newFixedThreadPool(1); // String url = this.getUrl(distribution, attr1, attr2, attr3); // Future<Response> response = executor.submit(new Request(new URL(url))); // InputStream input = response.get().getBody(); // executor.shutdown(); // // String body = IOUtils.toString(input, "UTF-8"); // return new AsyncResult<String>(body); // } catch (MalformedURLException e) { // e.printStackTrace(); // } // catch (InterruptedException e) { // e.printStackTrace(); // } // catch (ExecutionException e) { // e.printStackTrace(); // } catch (IOException e) { // e.printStackTrace(); // } // return null; // } // // private String getUrl(String distribution, String attr1, String attr2, String attr3) // { // String url = ""; // if (distribution.equals("gauss")) { // url = "?mu=" + attr1 + "&sigma=" + attr2 + "&k=0"; // } // if (distribution.equals("expo")) { // url = "?lambda=" + attr1 + "&k=" + attr3; // } // if (distribution.equals("gamma")) { // url = "?alpha=" + attr1 + "&beta=" + attr2 + "&k=" + attr3; // } // if (distribution.equals("log")) { // url = "?mu=" + attr1 + "&sigma=" + attr2 + "&k=" + attr3; // } // if (distribution.equals("pareto")) { // url = "?alpha=" + attr1 + "&k=" + attr3; // } // if (distribution.equals("weibull")) { // url = "?alpha=" + attr1 + "&beta=" + attr2 + "&k=" + attr3; // } // if (distribution.equals("uniform")){ // url = "?a=" + attr1 + "&b=" + attr2; // } // if (distribution.equals("constant")) // { // url = "?c=" + attr1; // } // return BASE_URL + distribution + url + "&test=false"; // } // } // Path: src/main/java/eu/cloudscale/showcase/servlets/PaymentController.java import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.concurrent.Future; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import eu.cloudscale.showcase.db.BuyConfirmResult; import eu.cloudscale.showcase.servlets.helpers.PaymentService; } String customerIdString = request.getParameter( "C_ID" ); Integer customerId = null; if( customerIdString != null && !customerIdString.isEmpty() ) { customerId = Integer.parseInt( customerIdString ); } String ccType = request.getParameter( "CC_TYPE" ); String ccNumber_str = request.getParameter( "CC_NUMBER" ); Long ccNumber = null; if( !ccNumber_str.isEmpty() ) ccNumber = Long.parseLong( ccNumber_str ); SimpleDateFormat sdf = new SimpleDateFormat("mm/dd/yyyy"); String ccName = request.getParameter( "CC_NAME" ); Date ccExpiry = null; try { ccExpiry = sdf.parse(request.getParameter( "CC_EXPIRY" )); } catch ( ParseException e ) { e.printStackTrace(); } String shipping = request.getParameter( "SHIPPING" ); String street1 = request.getParameter( "street1" );
BuyConfirmResult res = null;
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/model/hibernate/CcXacts.java
// Path: src/main/java/eu/cloudscale/showcase/db/model/IAuthor.java // public interface IAuthor // { // // public Integer getAId(); // // public void setAId(Integer AId); // // public String getAFname(); // // public void setAFname(String AFname); // // public String getALname(); // // public void setALname(String ALname); // // public String getAMname(); // // public void setAMname(String AMname); // // public Date getADob(); // // public void setADob(Date ADob); // // public String getABio(); // // public void setABio(String ABio); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICcXacts.java // public interface ICcXacts // { // // public Integer getId(); // // public void setId(Integer id); // // public ICountry getCountry(); // // public void setCountry(ICountry country); // // public IOrders getOrders(); // // public String getCxType(); // // public void setCxType(String cxType); // // public Integer getCxNum(); // // public void setCxNum(Integer cxNum); // // public String getCxName(); // // public void setCxName(String cxName); // // public Date getCxExpiry(); // // public void setCxExpiry(Date cxExpiry); // // public String getCxAuthId(); // // public void setCxAuthId(String cxAuthId); // // public Double getCxXactAmt(); // // public void setCxXactAmt(Double o_TOTAL); // // public Date getCxXactDate(); // // public void setCxXactDate(Date cxXactDate); // // public void setOrders(IOrders orders); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICountry.java // public interface ICountry // { // // public Integer getCoId(); // // public void setCoId(Integer coId); // // public String getCoName(); // // public void setCoName(String coName); // // public Double getCoExchange(); // // public void setCoExchange(Double coExchange); // // public String getCoCurrency(); // // public void setCoCurrency(String coCurrency); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IOrders.java // public interface IOrders // { // // public Integer getOId(); // // public void setOId(Integer OId); // // IAddress getAddressByOShipAddrId(); // // void setAddressByOShipAddrId(IAddress addressByOShipAddrId); // // ICustomer getCustomer(); // // void setCustomer(ICustomer customer); // // IAddress getAddressByOBillAddrId(); // // void setAddressByOBillAddrId(IAddress addressByOBillAddrId); // // // void setOStatus(String OStatus); // // String getOStatus(); // // void setOShipDate(Date OShipDate); // // Date getOShipDate(); // // void setOShipType(String OShipType); // // String getOShipType(); // // void setOTotal(double o_TOTAL); // // Double getOTotal(); // // void setOTax(Double o_TAX); // // Double getOTax(); // // void setOSubTotal(Double o_SUB_TOTAL); // // Double getOSubTotal(); // // void setODate(Date ODate); // // Date getODate(); // // public Set<IOrderLine> getOrderLines(); // // }
import eu.cloudscale.showcase.db.model.ICountry; import eu.cloudscale.showcase.db.model.IOrders; import static javax.persistence.GenerationType.IDENTITY; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToOne; import javax.persistence.Table; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import eu.cloudscale.showcase.db.model.IAuthor; import eu.cloudscale.showcase.db.model.ICcXacts;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.model.hibernate; // Generated May 16, 2013 3:07:18 PM by Hibernate Tools 4.0.0 /** * CcXacts generated by hbm2java */ @Entity @Table( name = "cc_xacts", catalog = "tpcw" ) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
// Path: src/main/java/eu/cloudscale/showcase/db/model/IAuthor.java // public interface IAuthor // { // // public Integer getAId(); // // public void setAId(Integer AId); // // public String getAFname(); // // public void setAFname(String AFname); // // public String getALname(); // // public void setALname(String ALname); // // public String getAMname(); // // public void setAMname(String AMname); // // public Date getADob(); // // public void setADob(Date ADob); // // public String getABio(); // // public void setABio(String ABio); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICcXacts.java // public interface ICcXacts // { // // public Integer getId(); // // public void setId(Integer id); // // public ICountry getCountry(); // // public void setCountry(ICountry country); // // public IOrders getOrders(); // // public String getCxType(); // // public void setCxType(String cxType); // // public Integer getCxNum(); // // public void setCxNum(Integer cxNum); // // public String getCxName(); // // public void setCxName(String cxName); // // public Date getCxExpiry(); // // public void setCxExpiry(Date cxExpiry); // // public String getCxAuthId(); // // public void setCxAuthId(String cxAuthId); // // public Double getCxXactAmt(); // // public void setCxXactAmt(Double o_TOTAL); // // public Date getCxXactDate(); // // public void setCxXactDate(Date cxXactDate); // // public void setOrders(IOrders orders); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICountry.java // public interface ICountry // { // // public Integer getCoId(); // // public void setCoId(Integer coId); // // public String getCoName(); // // public void setCoName(String coName); // // public Double getCoExchange(); // // public void setCoExchange(Double coExchange); // // public String getCoCurrency(); // // public void setCoCurrency(String coCurrency); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IOrders.java // public interface IOrders // { // // public Integer getOId(); // // public void setOId(Integer OId); // // IAddress getAddressByOShipAddrId(); // // void setAddressByOShipAddrId(IAddress addressByOShipAddrId); // // ICustomer getCustomer(); // // void setCustomer(ICustomer customer); // // IAddress getAddressByOBillAddrId(); // // void setAddressByOBillAddrId(IAddress addressByOBillAddrId); // // // void setOStatus(String OStatus); // // String getOStatus(); // // void setOShipDate(Date OShipDate); // // Date getOShipDate(); // // void setOShipType(String OShipType); // // String getOShipType(); // // void setOTotal(double o_TOTAL); // // Double getOTotal(); // // void setOTax(Double o_TAX); // // Double getOTax(); // // void setOSubTotal(Double o_SUB_TOTAL); // // Double getOSubTotal(); // // void setODate(Date ODate); // // Date getODate(); // // public Set<IOrderLine> getOrderLines(); // // } // Path: src/main/java/eu/cloudscale/showcase/db/model/hibernate/CcXacts.java import eu.cloudscale.showcase.db.model.ICountry; import eu.cloudscale.showcase.db.model.IOrders; import static javax.persistence.GenerationType.IDENTITY; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToOne; import javax.persistence.Table; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import eu.cloudscale.showcase.db.model.IAuthor; import eu.cloudscale.showcase.db.model.ICcXacts; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.model.hibernate; // Generated May 16, 2013 3:07:18 PM by Hibernate Tools 4.0.0 /** * CcXacts generated by hbm2java */ @Entity @Table( name = "cc_xacts", catalog = "tpcw" ) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class CcXacts implements ICcXacts
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/model/hibernate/CcXacts.java
// Path: src/main/java/eu/cloudscale/showcase/db/model/IAuthor.java // public interface IAuthor // { // // public Integer getAId(); // // public void setAId(Integer AId); // // public String getAFname(); // // public void setAFname(String AFname); // // public String getALname(); // // public void setALname(String ALname); // // public String getAMname(); // // public void setAMname(String AMname); // // public Date getADob(); // // public void setADob(Date ADob); // // public String getABio(); // // public void setABio(String ABio); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICcXacts.java // public interface ICcXacts // { // // public Integer getId(); // // public void setId(Integer id); // // public ICountry getCountry(); // // public void setCountry(ICountry country); // // public IOrders getOrders(); // // public String getCxType(); // // public void setCxType(String cxType); // // public Integer getCxNum(); // // public void setCxNum(Integer cxNum); // // public String getCxName(); // // public void setCxName(String cxName); // // public Date getCxExpiry(); // // public void setCxExpiry(Date cxExpiry); // // public String getCxAuthId(); // // public void setCxAuthId(String cxAuthId); // // public Double getCxXactAmt(); // // public void setCxXactAmt(Double o_TOTAL); // // public Date getCxXactDate(); // // public void setCxXactDate(Date cxXactDate); // // public void setOrders(IOrders orders); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICountry.java // public interface ICountry // { // // public Integer getCoId(); // // public void setCoId(Integer coId); // // public String getCoName(); // // public void setCoName(String coName); // // public Double getCoExchange(); // // public void setCoExchange(Double coExchange); // // public String getCoCurrency(); // // public void setCoCurrency(String coCurrency); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IOrders.java // public interface IOrders // { // // public Integer getOId(); // // public void setOId(Integer OId); // // IAddress getAddressByOShipAddrId(); // // void setAddressByOShipAddrId(IAddress addressByOShipAddrId); // // ICustomer getCustomer(); // // void setCustomer(ICustomer customer); // // IAddress getAddressByOBillAddrId(); // // void setAddressByOBillAddrId(IAddress addressByOBillAddrId); // // // void setOStatus(String OStatus); // // String getOStatus(); // // void setOShipDate(Date OShipDate); // // Date getOShipDate(); // // void setOShipType(String OShipType); // // String getOShipType(); // // void setOTotal(double o_TOTAL); // // Double getOTotal(); // // void setOTax(Double o_TAX); // // Double getOTax(); // // void setOSubTotal(Double o_SUB_TOTAL); // // Double getOSubTotal(); // // void setODate(Date ODate); // // Date getODate(); // // public Set<IOrderLine> getOrderLines(); // // }
import eu.cloudscale.showcase.db.model.ICountry; import eu.cloudscale.showcase.db.model.IOrders; import static javax.persistence.GenerationType.IDENTITY; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToOne; import javax.persistence.Table; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import eu.cloudscale.showcase.db.model.IAuthor; import eu.cloudscale.showcase.db.model.ICcXacts;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.model.hibernate; // Generated May 16, 2013 3:07:18 PM by Hibernate Tools 4.0.0 /** * CcXacts generated by hbm2java */ @Entity @Table( name = "cc_xacts", catalog = "tpcw" ) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public class CcXacts implements ICcXacts {
// Path: src/main/java/eu/cloudscale/showcase/db/model/IAuthor.java // public interface IAuthor // { // // public Integer getAId(); // // public void setAId(Integer AId); // // public String getAFname(); // // public void setAFname(String AFname); // // public String getALname(); // // public void setALname(String ALname); // // public String getAMname(); // // public void setAMname(String AMname); // // public Date getADob(); // // public void setADob(Date ADob); // // public String getABio(); // // public void setABio(String ABio); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICcXacts.java // public interface ICcXacts // { // // public Integer getId(); // // public void setId(Integer id); // // public ICountry getCountry(); // // public void setCountry(ICountry country); // // public IOrders getOrders(); // // public String getCxType(); // // public void setCxType(String cxType); // // public Integer getCxNum(); // // public void setCxNum(Integer cxNum); // // public String getCxName(); // // public void setCxName(String cxName); // // public Date getCxExpiry(); // // public void setCxExpiry(Date cxExpiry); // // public String getCxAuthId(); // // public void setCxAuthId(String cxAuthId); // // public Double getCxXactAmt(); // // public void setCxXactAmt(Double o_TOTAL); // // public Date getCxXactDate(); // // public void setCxXactDate(Date cxXactDate); // // public void setOrders(IOrders orders); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICountry.java // public interface ICountry // { // // public Integer getCoId(); // // public void setCoId(Integer coId); // // public String getCoName(); // // public void setCoName(String coName); // // public Double getCoExchange(); // // public void setCoExchange(Double coExchange); // // public String getCoCurrency(); // // public void setCoCurrency(String coCurrency); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IOrders.java // public interface IOrders // { // // public Integer getOId(); // // public void setOId(Integer OId); // // IAddress getAddressByOShipAddrId(); // // void setAddressByOShipAddrId(IAddress addressByOShipAddrId); // // ICustomer getCustomer(); // // void setCustomer(ICustomer customer); // // IAddress getAddressByOBillAddrId(); // // void setAddressByOBillAddrId(IAddress addressByOBillAddrId); // // // void setOStatus(String OStatus); // // String getOStatus(); // // void setOShipDate(Date OShipDate); // // Date getOShipDate(); // // void setOShipType(String OShipType); // // String getOShipType(); // // void setOTotal(double o_TOTAL); // // Double getOTotal(); // // void setOTax(Double o_TAX); // // Double getOTax(); // // void setOSubTotal(Double o_SUB_TOTAL); // // Double getOSubTotal(); // // void setODate(Date ODate); // // Date getODate(); // // public Set<IOrderLine> getOrderLines(); // // } // Path: src/main/java/eu/cloudscale/showcase/db/model/hibernate/CcXacts.java import eu.cloudscale.showcase.db.model.ICountry; import eu.cloudscale.showcase.db.model.IOrders; import static javax.persistence.GenerationType.IDENTITY; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToOne; import javax.persistence.Table; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import eu.cloudscale.showcase.db.model.IAuthor; import eu.cloudscale.showcase.db.model.ICcXacts; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.model.hibernate; // Generated May 16, 2013 3:07:18 PM by Hibernate Tools 4.0.0 /** * CcXacts generated by hbm2java */ @Entity @Table( name = "cc_xacts", catalog = "tpcw" ) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public class CcXacts implements ICcXacts {
private ICountry country;
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/model/hibernate/CcXacts.java
// Path: src/main/java/eu/cloudscale/showcase/db/model/IAuthor.java // public interface IAuthor // { // // public Integer getAId(); // // public void setAId(Integer AId); // // public String getAFname(); // // public void setAFname(String AFname); // // public String getALname(); // // public void setALname(String ALname); // // public String getAMname(); // // public void setAMname(String AMname); // // public Date getADob(); // // public void setADob(Date ADob); // // public String getABio(); // // public void setABio(String ABio); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICcXacts.java // public interface ICcXacts // { // // public Integer getId(); // // public void setId(Integer id); // // public ICountry getCountry(); // // public void setCountry(ICountry country); // // public IOrders getOrders(); // // public String getCxType(); // // public void setCxType(String cxType); // // public Integer getCxNum(); // // public void setCxNum(Integer cxNum); // // public String getCxName(); // // public void setCxName(String cxName); // // public Date getCxExpiry(); // // public void setCxExpiry(Date cxExpiry); // // public String getCxAuthId(); // // public void setCxAuthId(String cxAuthId); // // public Double getCxXactAmt(); // // public void setCxXactAmt(Double o_TOTAL); // // public Date getCxXactDate(); // // public void setCxXactDate(Date cxXactDate); // // public void setOrders(IOrders orders); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICountry.java // public interface ICountry // { // // public Integer getCoId(); // // public void setCoId(Integer coId); // // public String getCoName(); // // public void setCoName(String coName); // // public Double getCoExchange(); // // public void setCoExchange(Double coExchange); // // public String getCoCurrency(); // // public void setCoCurrency(String coCurrency); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IOrders.java // public interface IOrders // { // // public Integer getOId(); // // public void setOId(Integer OId); // // IAddress getAddressByOShipAddrId(); // // void setAddressByOShipAddrId(IAddress addressByOShipAddrId); // // ICustomer getCustomer(); // // void setCustomer(ICustomer customer); // // IAddress getAddressByOBillAddrId(); // // void setAddressByOBillAddrId(IAddress addressByOBillAddrId); // // // void setOStatus(String OStatus); // // String getOStatus(); // // void setOShipDate(Date OShipDate); // // Date getOShipDate(); // // void setOShipType(String OShipType); // // String getOShipType(); // // void setOTotal(double o_TOTAL); // // Double getOTotal(); // // void setOTax(Double o_TAX); // // Double getOTax(); // // void setOSubTotal(Double o_SUB_TOTAL); // // Double getOSubTotal(); // // void setODate(Date ODate); // // Date getODate(); // // public Set<IOrderLine> getOrderLines(); // // }
import eu.cloudscale.showcase.db.model.ICountry; import eu.cloudscale.showcase.db.model.IOrders; import static javax.persistence.GenerationType.IDENTITY; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToOne; import javax.persistence.Table; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import eu.cloudscale.showcase.db.model.IAuthor; import eu.cloudscale.showcase.db.model.ICcXacts;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.model.hibernate; // Generated May 16, 2013 3:07:18 PM by Hibernate Tools 4.0.0 /** * CcXacts generated by hbm2java */ @Entity @Table( name = "cc_xacts", catalog = "tpcw" ) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public class CcXacts implements ICcXacts { private ICountry country;
// Path: src/main/java/eu/cloudscale/showcase/db/model/IAuthor.java // public interface IAuthor // { // // public Integer getAId(); // // public void setAId(Integer AId); // // public String getAFname(); // // public void setAFname(String AFname); // // public String getALname(); // // public void setALname(String ALname); // // public String getAMname(); // // public void setAMname(String AMname); // // public Date getADob(); // // public void setADob(Date ADob); // // public String getABio(); // // public void setABio(String ABio); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICcXacts.java // public interface ICcXacts // { // // public Integer getId(); // // public void setId(Integer id); // // public ICountry getCountry(); // // public void setCountry(ICountry country); // // public IOrders getOrders(); // // public String getCxType(); // // public void setCxType(String cxType); // // public Integer getCxNum(); // // public void setCxNum(Integer cxNum); // // public String getCxName(); // // public void setCxName(String cxName); // // public Date getCxExpiry(); // // public void setCxExpiry(Date cxExpiry); // // public String getCxAuthId(); // // public void setCxAuthId(String cxAuthId); // // public Double getCxXactAmt(); // // public void setCxXactAmt(Double o_TOTAL); // // public Date getCxXactDate(); // // public void setCxXactDate(Date cxXactDate); // // public void setOrders(IOrders orders); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICountry.java // public interface ICountry // { // // public Integer getCoId(); // // public void setCoId(Integer coId); // // public String getCoName(); // // public void setCoName(String coName); // // public Double getCoExchange(); // // public void setCoExchange(Double coExchange); // // public String getCoCurrency(); // // public void setCoCurrency(String coCurrency); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IOrders.java // public interface IOrders // { // // public Integer getOId(); // // public void setOId(Integer OId); // // IAddress getAddressByOShipAddrId(); // // void setAddressByOShipAddrId(IAddress addressByOShipAddrId); // // ICustomer getCustomer(); // // void setCustomer(ICustomer customer); // // IAddress getAddressByOBillAddrId(); // // void setAddressByOBillAddrId(IAddress addressByOBillAddrId); // // // void setOStatus(String OStatus); // // String getOStatus(); // // void setOShipDate(Date OShipDate); // // Date getOShipDate(); // // void setOShipType(String OShipType); // // String getOShipType(); // // void setOTotal(double o_TOTAL); // // Double getOTotal(); // // void setOTax(Double o_TAX); // // Double getOTax(); // // void setOSubTotal(Double o_SUB_TOTAL); // // Double getOSubTotal(); // // void setODate(Date ODate); // // Date getODate(); // // public Set<IOrderLine> getOrderLines(); // // } // Path: src/main/java/eu/cloudscale/showcase/db/model/hibernate/CcXacts.java import eu.cloudscale.showcase.db.model.ICountry; import eu.cloudscale.showcase.db.model.IOrders; import static javax.persistence.GenerationType.IDENTITY; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToOne; import javax.persistence.Table; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import eu.cloudscale.showcase.db.model.IAuthor; import eu.cloudscale.showcase.db.model.ICcXacts; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.model.hibernate; // Generated May 16, 2013 3:07:18 PM by Hibernate Tools 4.0.0 /** * CcXacts generated by hbm2java */ @Entity @Table( name = "cc_xacts", catalog = "tpcw" ) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public class CcXacts implements ICcXacts { private ICountry country;
private IOrders orders;
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java
// Path: src/main/java/eu/cloudscale/showcase/db/model/IOrderLine.java // public interface IOrderLine // { // // public Integer getOlId(); // // public void setOlId(Integer olId); // // public IOrders getOrders(); // // public void setOrders(IOrders orders); // // public IItem getItem(); // // public void setItem(IItem item); // // public Integer getOlQty(); // // public void setOlQty(Integer olQty); // // public Double getOlDiscount(); // // public void setOlDiscount(Double oL_DISCOUNT); // // public String getOlComment(); // // public void setOlComment(String olComment); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IOrders.java // public interface IOrders // { // // public Integer getOId(); // // public void setOId(Integer OId); // // IAddress getAddressByOShipAddrId(); // // void setAddressByOShipAddrId(IAddress addressByOShipAddrId); // // ICustomer getCustomer(); // // void setCustomer(ICustomer customer); // // IAddress getAddressByOBillAddrId(); // // void setAddressByOBillAddrId(IAddress addressByOBillAddrId); // // // void setOStatus(String OStatus); // // String getOStatus(); // // void setOShipDate(Date OShipDate); // // Date getOShipDate(); // // void setOShipType(String OShipType); // // String getOShipType(); // // void setOTotal(double o_TOTAL); // // Double getOTotal(); // // void setOTax(Double o_TAX); // // Double getOTax(); // // void setOSubTotal(Double o_SUB_TOTAL); // // Double getOSubTotal(); // // void setODate(Date ODate); // // Date getODate(); // // public Set<IOrderLine> getOrderLines(); // // }
import java.util.List; import eu.cloudscale.showcase.db.model.IOrderLine; import eu.cloudscale.showcase.db.model.IOrders;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.dao; public interface IOrderLineDao extends IDao<IOrderLine> {
// Path: src/main/java/eu/cloudscale/showcase/db/model/IOrderLine.java // public interface IOrderLine // { // // public Integer getOlId(); // // public void setOlId(Integer olId); // // public IOrders getOrders(); // // public void setOrders(IOrders orders); // // public IItem getItem(); // // public void setItem(IItem item); // // public Integer getOlQty(); // // public void setOlQty(Integer olQty); // // public Double getOlDiscount(); // // public void setOlDiscount(Double oL_DISCOUNT); // // public String getOlComment(); // // public void setOlComment(String olComment); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IOrders.java // public interface IOrders // { // // public Integer getOId(); // // public void setOId(Integer OId); // // IAddress getAddressByOShipAddrId(); // // void setAddressByOShipAddrId(IAddress addressByOShipAddrId); // // ICustomer getCustomer(); // // void setCustomer(ICustomer customer); // // IAddress getAddressByOBillAddrId(); // // void setAddressByOBillAddrId(IAddress addressByOBillAddrId); // // // void setOStatus(String OStatus); // // String getOStatus(); // // void setOShipDate(Date OShipDate); // // Date getOShipDate(); // // void setOShipType(String OShipType); // // String getOShipType(); // // void setOTotal(double o_TOTAL); // // Double getOTotal(); // // void setOTax(Double o_TAX); // // Double getOTax(); // // void setOSubTotal(Double o_SUB_TOTAL); // // Double getOSubTotal(); // // void setODate(Date ODate); // // Date getODate(); // // public Set<IOrderLine> getOrderLines(); // // } // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java import java.util.List; import eu.cloudscale.showcase.db.model.IOrderLine; import eu.cloudscale.showcase.db.model.IOrders; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.dao; public interface IOrderLineDao extends IDao<IOrderLine> {
List<IOrderLine> findAllByOrder(IOrders orders);
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/servlets/AdminConfirmController.java
// Path: src/main/java/eu/cloudscale/showcase/db/model/IItem.java // public interface IItem // { // // public Integer getIId(); // // public void setIDimension(String IDimension); // // public String getIDimension(); // // public void setIBacking(String IBacking); // // public String getIBacking(); // // public void setIPage(String IPage); // // public String getIPage(); // // public void setIIsbn(String IIsbn); // // public String getIIsbn(); // // public void setIStock(Integer IStock); // // public Integer getIStock(); // // public void setIAvail(Date IAvail); // // public Date getIAvail(); // // public void setICost(Double i_COST); // // public Double getICost(); // // public void setISrp(Double i_SRP); // // public Double getISrp(); // // public void setIImage(String IImage); // // public String getIImage(); // // public void setIThumbnail(String IThumbnail); // // public String getIThumbnail(); // // public void setIRelated5(Integer IRelated5); // // public Integer getIRelated5(); // // public void setIRelated4(Integer IRelated4); // // public Integer getIRelated4(); // // public void setIRelated3(Integer IRelated3); // // public Integer getIRelated3(); // // public void setIRelated2(Integer IRelated2); // // public Integer getIRelated2(); // // public void setIRelated1(Integer IRelated1); // // public Integer getIRelated1(); // // public void setIDesc(String IDesc); // // public String getIDesc(); // // public void setISubject(String ISubject); // // public String getISubject(); // // public void setIPublisher(String IPublisher); // // public String getIPublisher(); // // public void setIPubDate(Date IPubDate); // // public Date getIPubDate(); // // public void setITitle(String ITitle); // // public String getITitle(); // // public void setAuthor(IAuthor author); // // public IAuthor getAuthor(); // // public void setIId(Integer IId); // // public double getIRandom(); // // public void setIRandom(double num); // }
import javax.servlet.http.HttpServletRequest; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import eu.cloudscale.showcase.db.model.IItem;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.servlets; @Controller @RequestMapping("/admin-confirm") public class AdminConfirmController extends AController { @RequestMapping(value="", method=RequestMethod.POST) public String post(@RequestParam(value="I_ID") Integer itemId, @RequestParam(value = "new_price", required=false) Double newPrice, @RequestParam(value = "new_picture", required=false) String newPicture, @RequestParam(value = "new_thumbnail", required=false) String newThumbnail, HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
// Path: src/main/java/eu/cloudscale/showcase/db/model/IItem.java // public interface IItem // { // // public Integer getIId(); // // public void setIDimension(String IDimension); // // public String getIDimension(); // // public void setIBacking(String IBacking); // // public String getIBacking(); // // public void setIPage(String IPage); // // public String getIPage(); // // public void setIIsbn(String IIsbn); // // public String getIIsbn(); // // public void setIStock(Integer IStock); // // public Integer getIStock(); // // public void setIAvail(Date IAvail); // // public Date getIAvail(); // // public void setICost(Double i_COST); // // public Double getICost(); // // public void setISrp(Double i_SRP); // // public Double getISrp(); // // public void setIImage(String IImage); // // public String getIImage(); // // public void setIThumbnail(String IThumbnail); // // public String getIThumbnail(); // // public void setIRelated5(Integer IRelated5); // // public Integer getIRelated5(); // // public void setIRelated4(Integer IRelated4); // // public Integer getIRelated4(); // // public void setIRelated3(Integer IRelated3); // // public Integer getIRelated3(); // // public void setIRelated2(Integer IRelated2); // // public Integer getIRelated2(); // // public void setIRelated1(Integer IRelated1); // // public Integer getIRelated1(); // // public void setIDesc(String IDesc); // // public String getIDesc(); // // public void setISubject(String ISubject); // // public String getISubject(); // // public void setIPublisher(String IPublisher); // // public String getIPublisher(); // // public void setIPubDate(Date IPubDate); // // public Date getIPubDate(); // // public void setITitle(String ITitle); // // public String getITitle(); // // public void setAuthor(IAuthor author); // // public IAuthor getAuthor(); // // public void setIId(Integer IId); // // public double getIRandom(); // // public void setIRandom(double num); // } // Path: src/main/java/eu/cloudscale/showcase/servlets/AdminConfirmController.java import javax.servlet.http.HttpServletRequest; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import eu.cloudscale.showcase.db.model.IItem; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.servlets; @Controller @RequestMapping("/admin-confirm") public class AdminConfirmController extends AController { @RequestMapping(value="", method=RequestMethod.POST) public String post(@RequestParam(value="I_ID") Integer itemId, @RequestParam(value = "new_price", required=false) Double newPrice, @RequestParam(value = "new_picture", required=false) String newPicture, @RequestParam(value = "new_thumbnail", required=false) String newThumbnail, HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
IItem item = service.findItemById(itemId);
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/model/hibernate/Customer.java
// Path: src/main/java/eu/cloudscale/showcase/db/model/IAddress.java // public interface IAddress // { // // public Integer getAddrId(); // // public void setAddrId(Integer addrId); // // public ICountry getCountry(); // // public void setCountry(ICountry country); // // public String getAddrStreet1(); // // public void setAddrStreet1(String addrStreet1); // // public String getAddrStreet2(); // // public void setAddrStreet2(String addrStreet2); // // public String getAddrCity(); // // public void setAddrCity(String addrCity); // // public String getAddrState(); // // public void setAddrState(String addrState); // // public String getAddrZip(); // // public void setAddrZip(String addrZip); // // public Set<ICustomer> getCustomers(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICustomer.java // public interface ICustomer // { // // public Integer getCId(); // // public void setCId(Integer CId); // // public IAddress getAddress(); // // public void setAddress(IAddress address); // // public String getCUname(); // // public void setCUname(String CUname); // // public String getCPasswd(); // // public void setCPasswd(String CPasswd); // // public String getCFname(); // // public void setCFname(String CFname); // // public String getCLname(); // // public void setCLname(String CLname); // // public String getCPhone(); // // public void setCData(String CData); // // public String getCData(); // // public void setCBirthdate(Date CBirthdate); // // public Date getCBirthdate(); // // public void setCYtdPmt(Double c_YTD_PMT); // // public Double getCYtdPmt(); // // public void setCBalance(Double c_BALANCE); // // public Double getCBalance(); // // public void setCDiscount(double c_DISCOUNT); // // public Double getCDiscount(); // // public void setCExpiration(Date CExpiration); // // public Date getCExpiration(); // // public void setCLogin(Date CLogin); // // public Date getCLogin(); // // public void setCLastVisit(Date CLastVisit); // // public Date getCLastVisit(); // // public void setCSince(Date CSince); // // public Date getCSince(); // // public void setCEmail(String CEmail); // // public String getCEmail(); // // public void setCPhone(String CPhone); // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IOrders.java // public interface IOrders // { // // public Integer getOId(); // // public void setOId(Integer OId); // // IAddress getAddressByOShipAddrId(); // // void setAddressByOShipAddrId(IAddress addressByOShipAddrId); // // ICustomer getCustomer(); // // void setCustomer(ICustomer customer); // // IAddress getAddressByOBillAddrId(); // // void setAddressByOBillAddrId(IAddress addressByOBillAddrId); // // // void setOStatus(String OStatus); // // String getOStatus(); // // void setOShipDate(Date OShipDate); // // Date getOShipDate(); // // void setOShipType(String OShipType); // // String getOShipType(); // // void setOTotal(double o_TOTAL); // // Double getOTotal(); // // void setOTax(Double o_TAX); // // Double getOTax(); // // void setOSubTotal(Double o_SUB_TOTAL); // // Double getOSubTotal(); // // void setODate(Date ODate); // // Date getODate(); // // public Set<IOrderLine> getOrderLines(); // // }
import static javax.persistence.GenerationType.IDENTITY; import java.util.Date; import java.util.HashSet; import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Index; import eu.cloudscale.showcase.db.model.IAddress; import eu.cloudscale.showcase.db.model.ICustomer; import eu.cloudscale.showcase.db.model.IOrders;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.model.hibernate; // Generated May 16, 2013 3:07:18 PM by Hibernate Tools 4.0.0 /** * Customer generated by hbm2java */ @Entity @Table( name = "customer", catalog = "tpcw" ) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
// Path: src/main/java/eu/cloudscale/showcase/db/model/IAddress.java // public interface IAddress // { // // public Integer getAddrId(); // // public void setAddrId(Integer addrId); // // public ICountry getCountry(); // // public void setCountry(ICountry country); // // public String getAddrStreet1(); // // public void setAddrStreet1(String addrStreet1); // // public String getAddrStreet2(); // // public void setAddrStreet2(String addrStreet2); // // public String getAddrCity(); // // public void setAddrCity(String addrCity); // // public String getAddrState(); // // public void setAddrState(String addrState); // // public String getAddrZip(); // // public void setAddrZip(String addrZip); // // public Set<ICustomer> getCustomers(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICustomer.java // public interface ICustomer // { // // public Integer getCId(); // // public void setCId(Integer CId); // // public IAddress getAddress(); // // public void setAddress(IAddress address); // // public String getCUname(); // // public void setCUname(String CUname); // // public String getCPasswd(); // // public void setCPasswd(String CPasswd); // // public String getCFname(); // // public void setCFname(String CFname); // // public String getCLname(); // // public void setCLname(String CLname); // // public String getCPhone(); // // public void setCData(String CData); // // public String getCData(); // // public void setCBirthdate(Date CBirthdate); // // public Date getCBirthdate(); // // public void setCYtdPmt(Double c_YTD_PMT); // // public Double getCYtdPmt(); // // public void setCBalance(Double c_BALANCE); // // public Double getCBalance(); // // public void setCDiscount(double c_DISCOUNT); // // public Double getCDiscount(); // // public void setCExpiration(Date CExpiration); // // public Date getCExpiration(); // // public void setCLogin(Date CLogin); // // public Date getCLogin(); // // public void setCLastVisit(Date CLastVisit); // // public Date getCLastVisit(); // // public void setCSince(Date CSince); // // public Date getCSince(); // // public void setCEmail(String CEmail); // // public String getCEmail(); // // public void setCPhone(String CPhone); // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IOrders.java // public interface IOrders // { // // public Integer getOId(); // // public void setOId(Integer OId); // // IAddress getAddressByOShipAddrId(); // // void setAddressByOShipAddrId(IAddress addressByOShipAddrId); // // ICustomer getCustomer(); // // void setCustomer(ICustomer customer); // // IAddress getAddressByOBillAddrId(); // // void setAddressByOBillAddrId(IAddress addressByOBillAddrId); // // // void setOStatus(String OStatus); // // String getOStatus(); // // void setOShipDate(Date OShipDate); // // Date getOShipDate(); // // void setOShipType(String OShipType); // // String getOShipType(); // // void setOTotal(double o_TOTAL); // // Double getOTotal(); // // void setOTax(Double o_TAX); // // Double getOTax(); // // void setOSubTotal(Double o_SUB_TOTAL); // // Double getOSubTotal(); // // void setODate(Date ODate); // // Date getODate(); // // public Set<IOrderLine> getOrderLines(); // // } // Path: src/main/java/eu/cloudscale/showcase/db/model/hibernate/Customer.java import static javax.persistence.GenerationType.IDENTITY; import java.util.Date; import java.util.HashSet; import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Index; import eu.cloudscale.showcase.db.model.IAddress; import eu.cloudscale.showcase.db.model.ICustomer; import eu.cloudscale.showcase.db.model.IOrders; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.model.hibernate; // Generated May 16, 2013 3:07:18 PM by Hibernate Tools 4.0.0 /** * Customer generated by hbm2java */ @Entity @Table( name = "customer", catalog = "tpcw" ) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Customer implements ICustomer
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/model/hibernate/Customer.java
// Path: src/main/java/eu/cloudscale/showcase/db/model/IAddress.java // public interface IAddress // { // // public Integer getAddrId(); // // public void setAddrId(Integer addrId); // // public ICountry getCountry(); // // public void setCountry(ICountry country); // // public String getAddrStreet1(); // // public void setAddrStreet1(String addrStreet1); // // public String getAddrStreet2(); // // public void setAddrStreet2(String addrStreet2); // // public String getAddrCity(); // // public void setAddrCity(String addrCity); // // public String getAddrState(); // // public void setAddrState(String addrState); // // public String getAddrZip(); // // public void setAddrZip(String addrZip); // // public Set<ICustomer> getCustomers(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICustomer.java // public interface ICustomer // { // // public Integer getCId(); // // public void setCId(Integer CId); // // public IAddress getAddress(); // // public void setAddress(IAddress address); // // public String getCUname(); // // public void setCUname(String CUname); // // public String getCPasswd(); // // public void setCPasswd(String CPasswd); // // public String getCFname(); // // public void setCFname(String CFname); // // public String getCLname(); // // public void setCLname(String CLname); // // public String getCPhone(); // // public void setCData(String CData); // // public String getCData(); // // public void setCBirthdate(Date CBirthdate); // // public Date getCBirthdate(); // // public void setCYtdPmt(Double c_YTD_PMT); // // public Double getCYtdPmt(); // // public void setCBalance(Double c_BALANCE); // // public Double getCBalance(); // // public void setCDiscount(double c_DISCOUNT); // // public Double getCDiscount(); // // public void setCExpiration(Date CExpiration); // // public Date getCExpiration(); // // public void setCLogin(Date CLogin); // // public Date getCLogin(); // // public void setCLastVisit(Date CLastVisit); // // public Date getCLastVisit(); // // public void setCSince(Date CSince); // // public Date getCSince(); // // public void setCEmail(String CEmail); // // public String getCEmail(); // // public void setCPhone(String CPhone); // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IOrders.java // public interface IOrders // { // // public Integer getOId(); // // public void setOId(Integer OId); // // IAddress getAddressByOShipAddrId(); // // void setAddressByOShipAddrId(IAddress addressByOShipAddrId); // // ICustomer getCustomer(); // // void setCustomer(ICustomer customer); // // IAddress getAddressByOBillAddrId(); // // void setAddressByOBillAddrId(IAddress addressByOBillAddrId); // // // void setOStatus(String OStatus); // // String getOStatus(); // // void setOShipDate(Date OShipDate); // // Date getOShipDate(); // // void setOShipType(String OShipType); // // String getOShipType(); // // void setOTotal(double o_TOTAL); // // Double getOTotal(); // // void setOTax(Double o_TAX); // // Double getOTax(); // // void setOSubTotal(Double o_SUB_TOTAL); // // Double getOSubTotal(); // // void setODate(Date ODate); // // Date getODate(); // // public Set<IOrderLine> getOrderLines(); // // }
import static javax.persistence.GenerationType.IDENTITY; import java.util.Date; import java.util.HashSet; import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Index; import eu.cloudscale.showcase.db.model.IAddress; import eu.cloudscale.showcase.db.model.ICustomer; import eu.cloudscale.showcase.db.model.IOrders;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.model.hibernate; // Generated May 16, 2013 3:07:18 PM by Hibernate Tools 4.0.0 /** * Customer generated by hbm2java */ @Entity @Table( name = "customer", catalog = "tpcw" ) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public class Customer implements ICustomer { private Integer CId;
// Path: src/main/java/eu/cloudscale/showcase/db/model/IAddress.java // public interface IAddress // { // // public Integer getAddrId(); // // public void setAddrId(Integer addrId); // // public ICountry getCountry(); // // public void setCountry(ICountry country); // // public String getAddrStreet1(); // // public void setAddrStreet1(String addrStreet1); // // public String getAddrStreet2(); // // public void setAddrStreet2(String addrStreet2); // // public String getAddrCity(); // // public void setAddrCity(String addrCity); // // public String getAddrState(); // // public void setAddrState(String addrState); // // public String getAddrZip(); // // public void setAddrZip(String addrZip); // // public Set<ICustomer> getCustomers(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICustomer.java // public interface ICustomer // { // // public Integer getCId(); // // public void setCId(Integer CId); // // public IAddress getAddress(); // // public void setAddress(IAddress address); // // public String getCUname(); // // public void setCUname(String CUname); // // public String getCPasswd(); // // public void setCPasswd(String CPasswd); // // public String getCFname(); // // public void setCFname(String CFname); // // public String getCLname(); // // public void setCLname(String CLname); // // public String getCPhone(); // // public void setCData(String CData); // // public String getCData(); // // public void setCBirthdate(Date CBirthdate); // // public Date getCBirthdate(); // // public void setCYtdPmt(Double c_YTD_PMT); // // public Double getCYtdPmt(); // // public void setCBalance(Double c_BALANCE); // // public Double getCBalance(); // // public void setCDiscount(double c_DISCOUNT); // // public Double getCDiscount(); // // public void setCExpiration(Date CExpiration); // // public Date getCExpiration(); // // public void setCLogin(Date CLogin); // // public Date getCLogin(); // // public void setCLastVisit(Date CLastVisit); // // public Date getCLastVisit(); // // public void setCSince(Date CSince); // // public Date getCSince(); // // public void setCEmail(String CEmail); // // public String getCEmail(); // // public void setCPhone(String CPhone); // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IOrders.java // public interface IOrders // { // // public Integer getOId(); // // public void setOId(Integer OId); // // IAddress getAddressByOShipAddrId(); // // void setAddressByOShipAddrId(IAddress addressByOShipAddrId); // // ICustomer getCustomer(); // // void setCustomer(ICustomer customer); // // IAddress getAddressByOBillAddrId(); // // void setAddressByOBillAddrId(IAddress addressByOBillAddrId); // // // void setOStatus(String OStatus); // // String getOStatus(); // // void setOShipDate(Date OShipDate); // // Date getOShipDate(); // // void setOShipType(String OShipType); // // String getOShipType(); // // void setOTotal(double o_TOTAL); // // Double getOTotal(); // // void setOTax(Double o_TAX); // // Double getOTax(); // // void setOSubTotal(Double o_SUB_TOTAL); // // Double getOSubTotal(); // // void setODate(Date ODate); // // Date getODate(); // // public Set<IOrderLine> getOrderLines(); // // } // Path: src/main/java/eu/cloudscale/showcase/db/model/hibernate/Customer.java import static javax.persistence.GenerationType.IDENTITY; import java.util.Date; import java.util.HashSet; import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Index; import eu.cloudscale.showcase.db.model.IAddress; import eu.cloudscale.showcase.db.model.ICustomer; import eu.cloudscale.showcase.db.model.IOrders; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.model.hibernate; // Generated May 16, 2013 3:07:18 PM by Hibernate Tools 4.0.0 /** * Customer generated by hbm2java */ @Entity @Table( name = "customer", catalog = "tpcw" ) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public class Customer implements ICustomer { private Integer CId;
private IAddress address;
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java
// Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCart.java // public interface IShoppingCart // { // // public void setScTime(Date scTime); // // public Date getScTime(); // // public void setScId(Integer scId); // // public Integer getScId(); // // public Set<IShoppingCartLine> getShoppingCartLines(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCartLine.java // public interface IShoppingCartLine // { // // public IShoppingCart getShoppingCart(); // // public void setShoppingCart(IShoppingCart shoppingCart); // // public Integer getSclId(); // // public void setSclId(Integer sclScId); // // public IItem getItem(); // // public void setItem(IItem item); // // public Integer getSclQty(); // // public void setSclQty(Integer sclQty); // // }
import java.util.List; import eu.cloudscale.showcase.db.model.IShoppingCart; import eu.cloudscale.showcase.db.model.IShoppingCartLine;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.dao; public interface IShoppingCartDao extends IDao<IShoppingCart> { // public Integer createEmptyCart(); public IShoppingCart findById(Integer shoppingId);
// Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCart.java // public interface IShoppingCart // { // // public void setScTime(Date scTime); // // public Date getScTime(); // // public void setScId(Integer scId); // // public Integer getScId(); // // public Set<IShoppingCartLine> getShoppingCartLines(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCartLine.java // public interface IShoppingCartLine // { // // public IShoppingCart getShoppingCart(); // // public void setShoppingCart(IShoppingCart shoppingCart); // // public Integer getSclId(); // // public void setSclId(Integer sclScId); // // public IItem getItem(); // // public void setItem(IItem item); // // public Integer getSclQty(); // // public void setSclQty(Integer sclQty); // // } // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java import java.util.List; import eu.cloudscale.showcase.db.model.IShoppingCart; import eu.cloudscale.showcase.db.model.IShoppingCartLine; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.dao; public interface IShoppingCartDao extends IDao<IShoppingCart> { // public Integer createEmptyCart(); public IShoppingCart findById(Integer shoppingId);
public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart);
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/model/mongo/ShoppingCartLine.java
// Path: src/main/java/eu/cloudscale/showcase/db/common/DatabaseHelper.java // public class DatabaseHelper // { // // public static IService getDatabase() // { // // IService db = (IService) ContextHelper.getApplicationContext().getBean( "service" ); // if (db == null) // { // System.out.println("Service is null"); // } // return db; // // } // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IItem.java // public interface IItem // { // // public Integer getIId(); // // public void setIDimension(String IDimension); // // public String getIDimension(); // // public void setIBacking(String IBacking); // // public String getIBacking(); // // public void setIPage(String IPage); // // public String getIPage(); // // public void setIIsbn(String IIsbn); // // public String getIIsbn(); // // public void setIStock(Integer IStock); // // public Integer getIStock(); // // public void setIAvail(Date IAvail); // // public Date getIAvail(); // // public void setICost(Double i_COST); // // public Double getICost(); // // public void setISrp(Double i_SRP); // // public Double getISrp(); // // public void setIImage(String IImage); // // public String getIImage(); // // public void setIThumbnail(String IThumbnail); // // public String getIThumbnail(); // // public void setIRelated5(Integer IRelated5); // // public Integer getIRelated5(); // // public void setIRelated4(Integer IRelated4); // // public Integer getIRelated4(); // // public void setIRelated3(Integer IRelated3); // // public Integer getIRelated3(); // // public void setIRelated2(Integer IRelated2); // // public Integer getIRelated2(); // // public void setIRelated1(Integer IRelated1); // // public Integer getIRelated1(); // // public void setIDesc(String IDesc); // // public String getIDesc(); // // public void setISubject(String ISubject); // // public String getISubject(); // // public void setIPublisher(String IPublisher); // // public String getIPublisher(); // // public void setIPubDate(Date IPubDate); // // public Date getIPubDate(); // // public void setITitle(String ITitle); // // public String getITitle(); // // public void setAuthor(IAuthor author); // // public IAuthor getAuthor(); // // public void setIId(Integer IId); // // public double getIRandom(); // // public void setIRandom(double num); // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCart.java // public interface IShoppingCart // { // // public void setScTime(Date scTime); // // public Date getScTime(); // // public void setScId(Integer scId); // // public Integer getScId(); // // public Set<IShoppingCartLine> getShoppingCartLines(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCartLine.java // public interface IShoppingCartLine // { // // public IShoppingCart getShoppingCart(); // // public void setShoppingCart(IShoppingCart shoppingCart); // // public Integer getSclId(); // // public void setSclId(Integer sclScId); // // public IItem getItem(); // // public void setItem(IItem item); // // public Integer getSclQty(); // // public void setSclQty(Integer sclQty); // // }
import java.io.Serializable; import org.bson.types.ObjectId; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.index.Indexed; import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.stereotype.Component; import eu.cloudscale.showcase.db.common.DatabaseHelper; import eu.cloudscale.showcase.db.model.IItem; import eu.cloudscale.showcase.db.model.IShoppingCart; import eu.cloudscale.showcase.db.model.IShoppingCartLine;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.model.mongo; @Component @Document( collection = "shoppingCartLine" )
// Path: src/main/java/eu/cloudscale/showcase/db/common/DatabaseHelper.java // public class DatabaseHelper // { // // public static IService getDatabase() // { // // IService db = (IService) ContextHelper.getApplicationContext().getBean( "service" ); // if (db == null) // { // System.out.println("Service is null"); // } // return db; // // } // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IItem.java // public interface IItem // { // // public Integer getIId(); // // public void setIDimension(String IDimension); // // public String getIDimension(); // // public void setIBacking(String IBacking); // // public String getIBacking(); // // public void setIPage(String IPage); // // public String getIPage(); // // public void setIIsbn(String IIsbn); // // public String getIIsbn(); // // public void setIStock(Integer IStock); // // public Integer getIStock(); // // public void setIAvail(Date IAvail); // // public Date getIAvail(); // // public void setICost(Double i_COST); // // public Double getICost(); // // public void setISrp(Double i_SRP); // // public Double getISrp(); // // public void setIImage(String IImage); // // public String getIImage(); // // public void setIThumbnail(String IThumbnail); // // public String getIThumbnail(); // // public void setIRelated5(Integer IRelated5); // // public Integer getIRelated5(); // // public void setIRelated4(Integer IRelated4); // // public Integer getIRelated4(); // // public void setIRelated3(Integer IRelated3); // // public Integer getIRelated3(); // // public void setIRelated2(Integer IRelated2); // // public Integer getIRelated2(); // // public void setIRelated1(Integer IRelated1); // // public Integer getIRelated1(); // // public void setIDesc(String IDesc); // // public String getIDesc(); // // public void setISubject(String ISubject); // // public String getISubject(); // // public void setIPublisher(String IPublisher); // // public String getIPublisher(); // // public void setIPubDate(Date IPubDate); // // public Date getIPubDate(); // // public void setITitle(String ITitle); // // public String getITitle(); // // public void setAuthor(IAuthor author); // // public IAuthor getAuthor(); // // public void setIId(Integer IId); // // public double getIRandom(); // // public void setIRandom(double num); // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCart.java // public interface IShoppingCart // { // // public void setScTime(Date scTime); // // public Date getScTime(); // // public void setScId(Integer scId); // // public Integer getScId(); // // public Set<IShoppingCartLine> getShoppingCartLines(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCartLine.java // public interface IShoppingCartLine // { // // public IShoppingCart getShoppingCart(); // // public void setShoppingCart(IShoppingCart shoppingCart); // // public Integer getSclId(); // // public void setSclId(Integer sclScId); // // public IItem getItem(); // // public void setItem(IItem item); // // public Integer getSclQty(); // // public void setSclQty(Integer sclQty); // // } // Path: src/main/java/eu/cloudscale/showcase/db/model/mongo/ShoppingCartLine.java import java.io.Serializable; import org.bson.types.ObjectId; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.index.Indexed; import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.stereotype.Component; import eu.cloudscale.showcase.db.common.DatabaseHelper; import eu.cloudscale.showcase.db.model.IItem; import eu.cloudscale.showcase.db.model.IShoppingCart; import eu.cloudscale.showcase.db.model.IShoppingCartLine; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.model.mongo; @Component @Document( collection = "shoppingCartLine" )
public class ShoppingCartLine implements IShoppingCartLine, Serializable
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/model/mongo/ShoppingCartLine.java
// Path: src/main/java/eu/cloudscale/showcase/db/common/DatabaseHelper.java // public class DatabaseHelper // { // // public static IService getDatabase() // { // // IService db = (IService) ContextHelper.getApplicationContext().getBean( "service" ); // if (db == null) // { // System.out.println("Service is null"); // } // return db; // // } // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IItem.java // public interface IItem // { // // public Integer getIId(); // // public void setIDimension(String IDimension); // // public String getIDimension(); // // public void setIBacking(String IBacking); // // public String getIBacking(); // // public void setIPage(String IPage); // // public String getIPage(); // // public void setIIsbn(String IIsbn); // // public String getIIsbn(); // // public void setIStock(Integer IStock); // // public Integer getIStock(); // // public void setIAvail(Date IAvail); // // public Date getIAvail(); // // public void setICost(Double i_COST); // // public Double getICost(); // // public void setISrp(Double i_SRP); // // public Double getISrp(); // // public void setIImage(String IImage); // // public String getIImage(); // // public void setIThumbnail(String IThumbnail); // // public String getIThumbnail(); // // public void setIRelated5(Integer IRelated5); // // public Integer getIRelated5(); // // public void setIRelated4(Integer IRelated4); // // public Integer getIRelated4(); // // public void setIRelated3(Integer IRelated3); // // public Integer getIRelated3(); // // public void setIRelated2(Integer IRelated2); // // public Integer getIRelated2(); // // public void setIRelated1(Integer IRelated1); // // public Integer getIRelated1(); // // public void setIDesc(String IDesc); // // public String getIDesc(); // // public void setISubject(String ISubject); // // public String getISubject(); // // public void setIPublisher(String IPublisher); // // public String getIPublisher(); // // public void setIPubDate(Date IPubDate); // // public Date getIPubDate(); // // public void setITitle(String ITitle); // // public String getITitle(); // // public void setAuthor(IAuthor author); // // public IAuthor getAuthor(); // // public void setIId(Integer IId); // // public double getIRandom(); // // public void setIRandom(double num); // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCart.java // public interface IShoppingCart // { // // public void setScTime(Date scTime); // // public Date getScTime(); // // public void setScId(Integer scId); // // public Integer getScId(); // // public Set<IShoppingCartLine> getShoppingCartLines(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCartLine.java // public interface IShoppingCartLine // { // // public IShoppingCart getShoppingCart(); // // public void setShoppingCart(IShoppingCart shoppingCart); // // public Integer getSclId(); // // public void setSclId(Integer sclScId); // // public IItem getItem(); // // public void setItem(IItem item); // // public Integer getSclQty(); // // public void setSclQty(Integer sclQty); // // }
import java.io.Serializable; import org.bson.types.ObjectId; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.index.Indexed; import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.stereotype.Component; import eu.cloudscale.showcase.db.common.DatabaseHelper; import eu.cloudscale.showcase.db.model.IItem; import eu.cloudscale.showcase.db.model.IShoppingCart; import eu.cloudscale.showcase.db.model.IShoppingCartLine;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.model.mongo; @Component @Document( collection = "shoppingCartLine" ) public class ShoppingCartLine implements IShoppingCartLine, Serializable { // @Autowired // @Qualifier("service") // private IService service; private static final long serialVersionUID = 767045854888711002L; @Id private ObjectId id; @Indexed private Integer sclId; private Integer item; private Integer sclQty; private Integer shoppingCart; public ShoppingCartLine() { } public ObjectId getId() { return id; } public void setId(ObjectId id) { this.id = id; } @Override
// Path: src/main/java/eu/cloudscale/showcase/db/common/DatabaseHelper.java // public class DatabaseHelper // { // // public static IService getDatabase() // { // // IService db = (IService) ContextHelper.getApplicationContext().getBean( "service" ); // if (db == null) // { // System.out.println("Service is null"); // } // return db; // // } // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IItem.java // public interface IItem // { // // public Integer getIId(); // // public void setIDimension(String IDimension); // // public String getIDimension(); // // public void setIBacking(String IBacking); // // public String getIBacking(); // // public void setIPage(String IPage); // // public String getIPage(); // // public void setIIsbn(String IIsbn); // // public String getIIsbn(); // // public void setIStock(Integer IStock); // // public Integer getIStock(); // // public void setIAvail(Date IAvail); // // public Date getIAvail(); // // public void setICost(Double i_COST); // // public Double getICost(); // // public void setISrp(Double i_SRP); // // public Double getISrp(); // // public void setIImage(String IImage); // // public String getIImage(); // // public void setIThumbnail(String IThumbnail); // // public String getIThumbnail(); // // public void setIRelated5(Integer IRelated5); // // public Integer getIRelated5(); // // public void setIRelated4(Integer IRelated4); // // public Integer getIRelated4(); // // public void setIRelated3(Integer IRelated3); // // public Integer getIRelated3(); // // public void setIRelated2(Integer IRelated2); // // public Integer getIRelated2(); // // public void setIRelated1(Integer IRelated1); // // public Integer getIRelated1(); // // public void setIDesc(String IDesc); // // public String getIDesc(); // // public void setISubject(String ISubject); // // public String getISubject(); // // public void setIPublisher(String IPublisher); // // public String getIPublisher(); // // public void setIPubDate(Date IPubDate); // // public Date getIPubDate(); // // public void setITitle(String ITitle); // // public String getITitle(); // // public void setAuthor(IAuthor author); // // public IAuthor getAuthor(); // // public void setIId(Integer IId); // // public double getIRandom(); // // public void setIRandom(double num); // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCart.java // public interface IShoppingCart // { // // public void setScTime(Date scTime); // // public Date getScTime(); // // public void setScId(Integer scId); // // public Integer getScId(); // // public Set<IShoppingCartLine> getShoppingCartLines(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCartLine.java // public interface IShoppingCartLine // { // // public IShoppingCart getShoppingCart(); // // public void setShoppingCart(IShoppingCart shoppingCart); // // public Integer getSclId(); // // public void setSclId(Integer sclScId); // // public IItem getItem(); // // public void setItem(IItem item); // // public Integer getSclQty(); // // public void setSclQty(Integer sclQty); // // } // Path: src/main/java/eu/cloudscale/showcase/db/model/mongo/ShoppingCartLine.java import java.io.Serializable; import org.bson.types.ObjectId; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.index.Indexed; import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.stereotype.Component; import eu.cloudscale.showcase.db.common.DatabaseHelper; import eu.cloudscale.showcase.db.model.IItem; import eu.cloudscale.showcase.db.model.IShoppingCart; import eu.cloudscale.showcase.db.model.IShoppingCartLine; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.model.mongo; @Component @Document( collection = "shoppingCartLine" ) public class ShoppingCartLine implements IShoppingCartLine, Serializable { // @Autowired // @Qualifier("service") // private IService service; private static final long serialVersionUID = 767045854888711002L; @Id private ObjectId id; @Indexed private Integer sclId; private Integer item; private Integer sclQty; private Integer shoppingCart; public ShoppingCartLine() { } public ObjectId getId() { return id; } public void setId(ObjectId id) { this.id = id; } @Override
public IShoppingCart getShoppingCart()
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/model/mongo/ShoppingCartLine.java
// Path: src/main/java/eu/cloudscale/showcase/db/common/DatabaseHelper.java // public class DatabaseHelper // { // // public static IService getDatabase() // { // // IService db = (IService) ContextHelper.getApplicationContext().getBean( "service" ); // if (db == null) // { // System.out.println("Service is null"); // } // return db; // // } // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IItem.java // public interface IItem // { // // public Integer getIId(); // // public void setIDimension(String IDimension); // // public String getIDimension(); // // public void setIBacking(String IBacking); // // public String getIBacking(); // // public void setIPage(String IPage); // // public String getIPage(); // // public void setIIsbn(String IIsbn); // // public String getIIsbn(); // // public void setIStock(Integer IStock); // // public Integer getIStock(); // // public void setIAvail(Date IAvail); // // public Date getIAvail(); // // public void setICost(Double i_COST); // // public Double getICost(); // // public void setISrp(Double i_SRP); // // public Double getISrp(); // // public void setIImage(String IImage); // // public String getIImage(); // // public void setIThumbnail(String IThumbnail); // // public String getIThumbnail(); // // public void setIRelated5(Integer IRelated5); // // public Integer getIRelated5(); // // public void setIRelated4(Integer IRelated4); // // public Integer getIRelated4(); // // public void setIRelated3(Integer IRelated3); // // public Integer getIRelated3(); // // public void setIRelated2(Integer IRelated2); // // public Integer getIRelated2(); // // public void setIRelated1(Integer IRelated1); // // public Integer getIRelated1(); // // public void setIDesc(String IDesc); // // public String getIDesc(); // // public void setISubject(String ISubject); // // public String getISubject(); // // public void setIPublisher(String IPublisher); // // public String getIPublisher(); // // public void setIPubDate(Date IPubDate); // // public Date getIPubDate(); // // public void setITitle(String ITitle); // // public String getITitle(); // // public void setAuthor(IAuthor author); // // public IAuthor getAuthor(); // // public void setIId(Integer IId); // // public double getIRandom(); // // public void setIRandom(double num); // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCart.java // public interface IShoppingCart // { // // public void setScTime(Date scTime); // // public Date getScTime(); // // public void setScId(Integer scId); // // public Integer getScId(); // // public Set<IShoppingCartLine> getShoppingCartLines(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCartLine.java // public interface IShoppingCartLine // { // // public IShoppingCart getShoppingCart(); // // public void setShoppingCart(IShoppingCart shoppingCart); // // public Integer getSclId(); // // public void setSclId(Integer sclScId); // // public IItem getItem(); // // public void setItem(IItem item); // // public Integer getSclQty(); // // public void setSclQty(Integer sclQty); // // }
import java.io.Serializable; import org.bson.types.ObjectId; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.index.Indexed; import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.stereotype.Component; import eu.cloudscale.showcase.db.common.DatabaseHelper; import eu.cloudscale.showcase.db.model.IItem; import eu.cloudscale.showcase.db.model.IShoppingCart; import eu.cloudscale.showcase.db.model.IShoppingCartLine;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.model.mongo; @Component @Document( collection = "shoppingCartLine" ) public class ShoppingCartLine implements IShoppingCartLine, Serializable { // @Autowired // @Qualifier("service") // private IService service; private static final long serialVersionUID = 767045854888711002L; @Id private ObjectId id; @Indexed private Integer sclId; private Integer item; private Integer sclQty; private Integer shoppingCart; public ShoppingCartLine() { } public ObjectId getId() { return id; } public void setId(ObjectId id) { this.id = id; } @Override public IShoppingCart getShoppingCart() {
// Path: src/main/java/eu/cloudscale/showcase/db/common/DatabaseHelper.java // public class DatabaseHelper // { // // public static IService getDatabase() // { // // IService db = (IService) ContextHelper.getApplicationContext().getBean( "service" ); // if (db == null) // { // System.out.println("Service is null"); // } // return db; // // } // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IItem.java // public interface IItem // { // // public Integer getIId(); // // public void setIDimension(String IDimension); // // public String getIDimension(); // // public void setIBacking(String IBacking); // // public String getIBacking(); // // public void setIPage(String IPage); // // public String getIPage(); // // public void setIIsbn(String IIsbn); // // public String getIIsbn(); // // public void setIStock(Integer IStock); // // public Integer getIStock(); // // public void setIAvail(Date IAvail); // // public Date getIAvail(); // // public void setICost(Double i_COST); // // public Double getICost(); // // public void setISrp(Double i_SRP); // // public Double getISrp(); // // public void setIImage(String IImage); // // public String getIImage(); // // public void setIThumbnail(String IThumbnail); // // public String getIThumbnail(); // // public void setIRelated5(Integer IRelated5); // // public Integer getIRelated5(); // // public void setIRelated4(Integer IRelated4); // // public Integer getIRelated4(); // // public void setIRelated3(Integer IRelated3); // // public Integer getIRelated3(); // // public void setIRelated2(Integer IRelated2); // // public Integer getIRelated2(); // // public void setIRelated1(Integer IRelated1); // // public Integer getIRelated1(); // // public void setIDesc(String IDesc); // // public String getIDesc(); // // public void setISubject(String ISubject); // // public String getISubject(); // // public void setIPublisher(String IPublisher); // // public String getIPublisher(); // // public void setIPubDate(Date IPubDate); // // public Date getIPubDate(); // // public void setITitle(String ITitle); // // public String getITitle(); // // public void setAuthor(IAuthor author); // // public IAuthor getAuthor(); // // public void setIId(Integer IId); // // public double getIRandom(); // // public void setIRandom(double num); // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCart.java // public interface IShoppingCart // { // // public void setScTime(Date scTime); // // public Date getScTime(); // // public void setScId(Integer scId); // // public Integer getScId(); // // public Set<IShoppingCartLine> getShoppingCartLines(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCartLine.java // public interface IShoppingCartLine // { // // public IShoppingCart getShoppingCart(); // // public void setShoppingCart(IShoppingCart shoppingCart); // // public Integer getSclId(); // // public void setSclId(Integer sclScId); // // public IItem getItem(); // // public void setItem(IItem item); // // public Integer getSclQty(); // // public void setSclQty(Integer sclQty); // // } // Path: src/main/java/eu/cloudscale/showcase/db/model/mongo/ShoppingCartLine.java import java.io.Serializable; import org.bson.types.ObjectId; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.index.Indexed; import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.stereotype.Component; import eu.cloudscale.showcase.db.common.DatabaseHelper; import eu.cloudscale.showcase.db.model.IItem; import eu.cloudscale.showcase.db.model.IShoppingCart; import eu.cloudscale.showcase.db.model.IShoppingCartLine; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db.model.mongo; @Component @Document( collection = "shoppingCartLine" ) public class ShoppingCartLine implements IShoppingCartLine, Serializable { // @Autowired // @Qualifier("service") // private IService service; private static final long serialVersionUID = 767045854888711002L; @Id private ObjectId id; @Indexed private Integer sclId; private Integer item; private Integer sclQty; private Integer shoppingCart; public ShoppingCartLine() { } public ObjectId getId() { return id; } public void setId(ObjectId id) { this.id = id; } @Override public IShoppingCart getShoppingCart() {
return DatabaseHelper.getDatabase().findShoppingCartById( shoppingCart );
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/model/mongo/ShoppingCartLine.java
// Path: src/main/java/eu/cloudscale/showcase/db/common/DatabaseHelper.java // public class DatabaseHelper // { // // public static IService getDatabase() // { // // IService db = (IService) ContextHelper.getApplicationContext().getBean( "service" ); // if (db == null) // { // System.out.println("Service is null"); // } // return db; // // } // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IItem.java // public interface IItem // { // // public Integer getIId(); // // public void setIDimension(String IDimension); // // public String getIDimension(); // // public void setIBacking(String IBacking); // // public String getIBacking(); // // public void setIPage(String IPage); // // public String getIPage(); // // public void setIIsbn(String IIsbn); // // public String getIIsbn(); // // public void setIStock(Integer IStock); // // public Integer getIStock(); // // public void setIAvail(Date IAvail); // // public Date getIAvail(); // // public void setICost(Double i_COST); // // public Double getICost(); // // public void setISrp(Double i_SRP); // // public Double getISrp(); // // public void setIImage(String IImage); // // public String getIImage(); // // public void setIThumbnail(String IThumbnail); // // public String getIThumbnail(); // // public void setIRelated5(Integer IRelated5); // // public Integer getIRelated5(); // // public void setIRelated4(Integer IRelated4); // // public Integer getIRelated4(); // // public void setIRelated3(Integer IRelated3); // // public Integer getIRelated3(); // // public void setIRelated2(Integer IRelated2); // // public Integer getIRelated2(); // // public void setIRelated1(Integer IRelated1); // // public Integer getIRelated1(); // // public void setIDesc(String IDesc); // // public String getIDesc(); // // public void setISubject(String ISubject); // // public String getISubject(); // // public void setIPublisher(String IPublisher); // // public String getIPublisher(); // // public void setIPubDate(Date IPubDate); // // public Date getIPubDate(); // // public void setITitle(String ITitle); // // public String getITitle(); // // public void setAuthor(IAuthor author); // // public IAuthor getAuthor(); // // public void setIId(Integer IId); // // public double getIRandom(); // // public void setIRandom(double num); // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCart.java // public interface IShoppingCart // { // // public void setScTime(Date scTime); // // public Date getScTime(); // // public void setScId(Integer scId); // // public Integer getScId(); // // public Set<IShoppingCartLine> getShoppingCartLines(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCartLine.java // public interface IShoppingCartLine // { // // public IShoppingCart getShoppingCart(); // // public void setShoppingCart(IShoppingCart shoppingCart); // // public Integer getSclId(); // // public void setSclId(Integer sclScId); // // public IItem getItem(); // // public void setItem(IItem item); // // public Integer getSclQty(); // // public void setSclQty(Integer sclQty); // // }
import java.io.Serializable; import org.bson.types.ObjectId; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.index.Indexed; import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.stereotype.Component; import eu.cloudscale.showcase.db.common.DatabaseHelper; import eu.cloudscale.showcase.db.model.IItem; import eu.cloudscale.showcase.db.model.IShoppingCart; import eu.cloudscale.showcase.db.model.IShoppingCartLine;
public void setId(ObjectId id) { this.id = id; } @Override public IShoppingCart getShoppingCart() { return DatabaseHelper.getDatabase().findShoppingCartById( shoppingCart ); } @Override public void setShoppingCart(IShoppingCart shoppingCart) { this.shoppingCart = shoppingCart.getScId(); } @Override public Integer getSclId() { return this.sclId; } @Override public void setSclId(Integer sclScId) { this.sclId = sclScId; } @Override
// Path: src/main/java/eu/cloudscale/showcase/db/common/DatabaseHelper.java // public class DatabaseHelper // { // // public static IService getDatabase() // { // // IService db = (IService) ContextHelper.getApplicationContext().getBean( "service" ); // if (db == null) // { // System.out.println("Service is null"); // } // return db; // // } // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IItem.java // public interface IItem // { // // public Integer getIId(); // // public void setIDimension(String IDimension); // // public String getIDimension(); // // public void setIBacking(String IBacking); // // public String getIBacking(); // // public void setIPage(String IPage); // // public String getIPage(); // // public void setIIsbn(String IIsbn); // // public String getIIsbn(); // // public void setIStock(Integer IStock); // // public Integer getIStock(); // // public void setIAvail(Date IAvail); // // public Date getIAvail(); // // public void setICost(Double i_COST); // // public Double getICost(); // // public void setISrp(Double i_SRP); // // public Double getISrp(); // // public void setIImage(String IImage); // // public String getIImage(); // // public void setIThumbnail(String IThumbnail); // // public String getIThumbnail(); // // public void setIRelated5(Integer IRelated5); // // public Integer getIRelated5(); // // public void setIRelated4(Integer IRelated4); // // public Integer getIRelated4(); // // public void setIRelated3(Integer IRelated3); // // public Integer getIRelated3(); // // public void setIRelated2(Integer IRelated2); // // public Integer getIRelated2(); // // public void setIRelated1(Integer IRelated1); // // public Integer getIRelated1(); // // public void setIDesc(String IDesc); // // public String getIDesc(); // // public void setISubject(String ISubject); // // public String getISubject(); // // public void setIPublisher(String IPublisher); // // public String getIPublisher(); // // public void setIPubDate(Date IPubDate); // // public Date getIPubDate(); // // public void setITitle(String ITitle); // // public String getITitle(); // // public void setAuthor(IAuthor author); // // public IAuthor getAuthor(); // // public void setIId(Integer IId); // // public double getIRandom(); // // public void setIRandom(double num); // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCart.java // public interface IShoppingCart // { // // public void setScTime(Date scTime); // // public Date getScTime(); // // public void setScId(Integer scId); // // public Integer getScId(); // // public Set<IShoppingCartLine> getShoppingCartLines(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/IShoppingCartLine.java // public interface IShoppingCartLine // { // // public IShoppingCart getShoppingCart(); // // public void setShoppingCart(IShoppingCart shoppingCart); // // public Integer getSclId(); // // public void setSclId(Integer sclScId); // // public IItem getItem(); // // public void setItem(IItem item); // // public Integer getSclQty(); // // public void setSclQty(Integer sclQty); // // } // Path: src/main/java/eu/cloudscale/showcase/db/model/mongo/ShoppingCartLine.java import java.io.Serializable; import org.bson.types.ObjectId; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.index.Indexed; import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.stereotype.Component; import eu.cloudscale.showcase.db.common.DatabaseHelper; import eu.cloudscale.showcase.db.model.IItem; import eu.cloudscale.showcase.db.model.IShoppingCart; import eu.cloudscale.showcase.db.model.IShoppingCartLine; public void setId(ObjectId id) { this.id = id; } @Override public IShoppingCart getShoppingCart() { return DatabaseHelper.getDatabase().findShoppingCartById( shoppingCart ); } @Override public void setShoppingCart(IShoppingCart shoppingCart) { this.shoppingCart = shoppingCart.getScId(); } @Override public Integer getSclId() { return this.sclId; } @Override public void setSclId(Integer sclScId) { this.sclId = sclScId; } @Override
public IItem getItem()
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/servlets/LoginController.java
// Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICustomer.java // public interface ICustomer // { // // public Integer getCId(); // // public void setCId(Integer CId); // // public IAddress getAddress(); // // public void setAddress(IAddress address); // // public String getCUname(); // // public void setCUname(String CUname); // // public String getCPasswd(); // // public void setCPasswd(String CPasswd); // // public String getCFname(); // // public void setCFname(String CFname); // // public String getCLname(); // // public void setCLname(String CLname); // // public String getCPhone(); // // public void setCData(String CData); // // public String getCData(); // // public void setCBirthdate(Date CBirthdate); // // public Date getCBirthdate(); // // public void setCYtdPmt(Double c_YTD_PMT); // // public Double getCYtdPmt(); // // public void setCBalance(Double c_BALANCE); // // public Double getCBalance(); // // public void setCDiscount(double c_DISCOUNT); // // public Double getCDiscount(); // // public void setCExpiration(Date CExpiration); // // public Date getCExpiration(); // // public void setCLogin(Date CLogin); // // public Date getCLogin(); // // public void setCLastVisit(Date CLastVisit); // // public Date getCLastVisit(); // // public void setCSince(Date CSince); // // public Date getCSince(); // // public void setCEmail(String CEmail); // // public String getCEmail(); // // public void setCPhone(String CPhone); // }
import java.util.Calendar; import java.util.Date; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.model.ICustomer;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.servlets; @Controller @RequestMapping("/login") public class LoginController extends AController { @RequestMapping(value="", method=RequestMethod.GET) public String get(HttpServletRequest request, HttpSession session, Model model) { String referer = request.getParameter("next"); if( referer.isEmpty() ) referer = request.getHeader( "referer" ); if( session.getAttribute( "customer" ) != null) return "redirect:" + referer == null ? "/" : referer; model.addAttribute("referer", referer); return "login"; } @RequestMapping(value="", method=RequestMethod.POST) public String post(@RequestParam("username") String username, @RequestParam("password") String password, @RequestParam("referer") String referer, HttpSession session, Model model) {
// Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/model/ICustomer.java // public interface ICustomer // { // // public Integer getCId(); // // public void setCId(Integer CId); // // public IAddress getAddress(); // // public void setAddress(IAddress address); // // public String getCUname(); // // public void setCUname(String CUname); // // public String getCPasswd(); // // public void setCPasswd(String CPasswd); // // public String getCFname(); // // public void setCFname(String CFname); // // public String getCLname(); // // public void setCLname(String CLname); // // public String getCPhone(); // // public void setCData(String CData); // // public String getCData(); // // public void setCBirthdate(Date CBirthdate); // // public Date getCBirthdate(); // // public void setCYtdPmt(Double c_YTD_PMT); // // public Double getCYtdPmt(); // // public void setCBalance(Double c_BALANCE); // // public Double getCBalance(); // // public void setCDiscount(double c_DISCOUNT); // // public Double getCDiscount(); // // public void setCExpiration(Date CExpiration); // // public Date getCExpiration(); // // public void setCLogin(Date CLogin); // // public Date getCLogin(); // // public void setCLastVisit(Date CLastVisit); // // public Date getCLastVisit(); // // public void setCSince(Date CSince); // // public Date getCSince(); // // public void setCEmail(String CEmail); // // public String getCEmail(); // // public void setCPhone(String CPhone); // } // Path: src/main/java/eu/cloudscale/showcase/servlets/LoginController.java import java.util.Calendar; import java.util.Date; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.model.ICustomer; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.servlets; @Controller @RequestMapping("/login") public class LoginController extends AController { @RequestMapping(value="", method=RequestMethod.GET) public String get(HttpServletRequest request, HttpSession session, Model model) { String referer = request.getParameter("next"); if( referer.isEmpty() ) referer = request.getHeader( "referer" ); if( session.getAttribute( "customer" ) != null) return "redirect:" + referer == null ? "/" : referer; model.addAttribute("referer", referer); return "login"; } @RequestMapping(value="", method=RequestMethod.POST) public String post(@RequestParam("username") String username, @RequestParam("password") String password, @RequestParam("referer") String referer, HttpSession session, Model model) {
ICustomer customer = null;
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/IDaos.java
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // }
import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos {
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // } // Path: src/main/java/eu/cloudscale/showcase/db/IDaos.java import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos {
public IAddressDao getAddressDaoImpl();
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/IDaos.java
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // }
import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl();
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // } // Path: src/main/java/eu/cloudscale/showcase/db/IDaos.java import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl();
public IAuthorDao getAuthorDaoImpl();
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/IDaos.java
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // }
import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl(); public IAuthorDao getAuthorDaoImpl();
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // } // Path: src/main/java/eu/cloudscale/showcase/db/IDaos.java import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl(); public IAuthorDao getAuthorDaoImpl();
public ICcXactsDao getCcXactsDaoImpl();
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/IDaos.java
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // }
import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl(); public IAuthorDao getAuthorDaoImpl(); public ICcXactsDao getCcXactsDaoImpl();
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // } // Path: src/main/java/eu/cloudscale/showcase/db/IDaos.java import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl(); public IAuthorDao getAuthorDaoImpl(); public ICcXactsDao getCcXactsDaoImpl();
public ICountryDao getCountryDaoImpl();
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/IDaos.java
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // }
import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl(); public IAuthorDao getAuthorDaoImpl(); public ICcXactsDao getCcXactsDaoImpl(); public ICountryDao getCountryDaoImpl();
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // } // Path: src/main/java/eu/cloudscale/showcase/db/IDaos.java import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl(); public IAuthorDao getAuthorDaoImpl(); public ICcXactsDao getCcXactsDaoImpl(); public ICountryDao getCountryDaoImpl();
public ICustomerDao getCustomerDaoImpl();
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/IDaos.java
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // }
import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl(); public IAuthorDao getAuthorDaoImpl(); public ICcXactsDao getCcXactsDaoImpl(); public ICountryDao getCountryDaoImpl(); public ICustomerDao getCustomerDaoImpl();
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // } // Path: src/main/java/eu/cloudscale/showcase/db/IDaos.java import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl(); public IAuthorDao getAuthorDaoImpl(); public ICcXactsDao getCcXactsDaoImpl(); public ICountryDao getCountryDaoImpl(); public ICustomerDao getCustomerDaoImpl();
public IItemDao getItemDaoImpl();
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/IDaos.java
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // }
import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl(); public IAuthorDao getAuthorDaoImpl(); public ICcXactsDao getCcXactsDaoImpl(); public ICountryDao getCountryDaoImpl(); public ICustomerDao getCustomerDaoImpl(); public IItemDao getItemDaoImpl();
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // } // Path: src/main/java/eu/cloudscale/showcase/db/IDaos.java import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl(); public IAuthorDao getAuthorDaoImpl(); public ICcXactsDao getCcXactsDaoImpl(); public ICountryDao getCountryDaoImpl(); public ICustomerDao getCustomerDaoImpl(); public IItemDao getItemDaoImpl();
public IOrderLineDao getOrderLineDaoImpl();
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/IDaos.java
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // }
import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl(); public IAuthorDao getAuthorDaoImpl(); public ICcXactsDao getCcXactsDaoImpl(); public ICountryDao getCountryDaoImpl(); public ICustomerDao getCustomerDaoImpl(); public IItemDao getItemDaoImpl(); public IOrderLineDao getOrderLineDaoImpl();
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // } // Path: src/main/java/eu/cloudscale/showcase/db/IDaos.java import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl(); public IAuthorDao getAuthorDaoImpl(); public ICcXactsDao getCcXactsDaoImpl(); public ICountryDao getCountryDaoImpl(); public ICustomerDao getCustomerDaoImpl(); public IItemDao getItemDaoImpl(); public IOrderLineDao getOrderLineDaoImpl();
public IOrdersDao getOrdersDaoImpl();
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/IDaos.java
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // }
import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl(); public IAuthorDao getAuthorDaoImpl(); public ICcXactsDao getCcXactsDaoImpl(); public ICountryDao getCountryDaoImpl(); public ICustomerDao getCustomerDaoImpl(); public IItemDao getItemDaoImpl(); public IOrderLineDao getOrderLineDaoImpl(); public IOrdersDao getOrdersDaoImpl();
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // } // Path: src/main/java/eu/cloudscale/showcase/db/IDaos.java import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl(); public IAuthorDao getAuthorDaoImpl(); public ICcXactsDao getCcXactsDaoImpl(); public ICountryDao getCountryDaoImpl(); public ICustomerDao getCustomerDaoImpl(); public IItemDao getItemDaoImpl(); public IOrderLineDao getOrderLineDaoImpl(); public IOrdersDao getOrdersDaoImpl();
public IShoppingCartLineDao getShoppingCartLineDaoImpl();
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/db/IDaos.java
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // }
import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao;
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl(); public IAuthorDao getAuthorDaoImpl(); public ICcXactsDao getCcXactsDaoImpl(); public ICountryDao getCountryDaoImpl(); public ICustomerDao getCustomerDaoImpl(); public IItemDao getItemDaoImpl(); public IOrderLineDao getOrderLineDaoImpl(); public IOrdersDao getOrdersDaoImpl(); public IShoppingCartLineDao getShoppingCartLineDaoImpl();
// Path: src/main/java/eu/cloudscale/showcase/db/dao/IAddressDao.java // public interface IAddressDao extends IDao<IAddress> // { // public List<IAddress> findAll(); // // public IAddress findById(int id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IAuthorDao.java // public interface IAuthorDao extends IDao<IAuthor> // { // public List<IAuthor> findAll(); // // public IAuthor findById(int id); // // public List<IAuthor> findBySoundexLname(String keyword); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICcXactsDao.java // public interface ICcXactsDao extends IDao<ICcXacts> // { // // int getLastCcXactsId(); // // public ICcXacts findById(Integer id); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICountryDao.java // public interface ICountryDao extends IDao<ICountry> // { // // public ICountry findById(int id); // // public ICountry getByName(String country); // // public void createTable(); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/ICustomerDao.java // public interface ICustomerDao extends IDao<ICustomer> // { // // public ICustomer findById(Integer id); // // public ICustomer getUserBy(String username, String password); // // public List<ICustomer> findByAddress(IAddress addrId); // // // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IItemDao.java // public interface IItemDao extends IDao<IItem> // { // public List<IItem> findAll(); // public IItem findById(int id); // public List<IItem> getPromotional(); // public List<IItem> getNewProducts(String category); // public List<Object[]> getBestSellers(String category); // public IItem getRandomItem(); // public IItem getObject(); // public List<IItem> findAllByAuthor(IAuthor author); // public List<IItem> findAllByTitle(String keyword); // public List<IItem> findAllBySubject(String keyword); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrderLineDao.java // public interface IOrderLineDao extends IDao<IOrderLine> // { // // List<IOrderLine> findAllByOrder(IOrders orders); // IOrderLine findById(Integer id); // // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IOrdersDao.java // public interface IOrdersDao extends IDao<IOrders> // { // public IOrders getMostRecentOrder(ICustomer customer); // // public IOrders findById(Integer cxOId); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartDao.java // public interface IShoppingCartDao extends IDao<IShoppingCart> // { // // public Integer createEmptyCart(); // // public IShoppingCart findById(Integer shoppingId); // // public List<IShoppingCartLine> findAllBySC(IShoppingCart shoppingCart); // } // // Path: src/main/java/eu/cloudscale/showcase/db/dao/IShoppingCartLineDao.java // public interface IShoppingCartLineDao extends IDao<IShoppingCartLine> // { // // public IShoppingCartLine getBySCandItem(Integer shoppingId, int itemId); // // public void delete(IShoppingCartLine bySCandItem); // // public boolean isCartEmpty(int scId); // // public List<Object[]> findBySCId(Integer shoppingId); // // } // Path: src/main/java/eu/cloudscale/showcase/db/IDaos.java import eu.cloudscale.showcase.db.dao.IAddressDao; import eu.cloudscale.showcase.db.dao.IAuthorDao; import eu.cloudscale.showcase.db.dao.ICcXactsDao; import eu.cloudscale.showcase.db.dao.ICountryDao; import eu.cloudscale.showcase.db.dao.ICustomerDao; import eu.cloudscale.showcase.db.dao.IItemDao; import eu.cloudscale.showcase.db.dao.IOrderLineDao; import eu.cloudscale.showcase.db.dao.IOrdersDao; import eu.cloudscale.showcase.db.dao.IShoppingCartDao; import eu.cloudscale.showcase.db.dao.IShoppingCartLineDao; /******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * @author XLAB d.o.o. *******************************************************************************/ package eu.cloudscale.showcase.db; public interface IDaos { public IAddressDao getAddressDaoImpl(); public IAuthorDao getAuthorDaoImpl(); public ICcXactsDao getCcXactsDaoImpl(); public ICountryDao getCountryDaoImpl(); public ICustomerDao getCustomerDaoImpl(); public IItemDao getItemDaoImpl(); public IOrderLineDao getOrderLineDaoImpl(); public IOrdersDao getOrdersDaoImpl(); public IShoppingCartLineDao getShoppingCartLineDaoImpl();
public IShoppingCartDao getShoppingCartDaoImpl();
honghailiang/SpringMango
src/main/java/com/mango/jtt/service/ProductServiceImpl.java
// Path: src/main/java/com/mango/jtt/dao/IMangoDao.java // public interface IMangoDao { // // /** // * 根据查询条件获取查询结果 // * @param querySql // * @param map 条件参数 // * @return // */ // List list(String querySql, Map<String, Object> map); // // /** // * 根据id获取对象 // * // * @param clazz // * @param productId // * @return // */ // Object get(Class clazz, Long productId); // // /** // * 保存对象 // * // * @param object // */ // void saveBean(Object object); // // /** // * 更新对象 // * // * @param object // */ // void updateBean(Object object); // // Connection getConnection() throws SQLException; // } // // Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // }
import java.sql.*; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.mango.jtt.dao.IMangoDao; import com.mango.jtt.po.Product;
/** * */ package com.mango.jtt.service; /** * @author HHL * * @date 2016年11月30日 */ @Service public class ProductServiceImpl implements IProductService { @Autowired
// Path: src/main/java/com/mango/jtt/dao/IMangoDao.java // public interface IMangoDao { // // /** // * 根据查询条件获取查询结果 // * @param querySql // * @param map 条件参数 // * @return // */ // List list(String querySql, Map<String, Object> map); // // /** // * 根据id获取对象 // * // * @param clazz // * @param productId // * @return // */ // Object get(Class clazz, Long productId); // // /** // * 保存对象 // * // * @param object // */ // void saveBean(Object object); // // /** // * 更新对象 // * // * @param object // */ // void updateBean(Object object); // // Connection getConnection() throws SQLException; // } // // Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // Path: src/main/java/com/mango/jtt/service/ProductServiceImpl.java import java.sql.*; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.mango.jtt.dao.IMangoDao; import com.mango.jtt.po.Product; /** * */ package com.mango.jtt.service; /** * @author HHL * * @date 2016年11月30日 */ @Service public class ProductServiceImpl implements IProductService { @Autowired
private IMangoDao dao;
honghailiang/SpringMango
src/main/java/com/mango/jtt/service/ProductServiceImpl.java
// Path: src/main/java/com/mango/jtt/dao/IMangoDao.java // public interface IMangoDao { // // /** // * 根据查询条件获取查询结果 // * @param querySql // * @param map 条件参数 // * @return // */ // List list(String querySql, Map<String, Object> map); // // /** // * 根据id获取对象 // * // * @param clazz // * @param productId // * @return // */ // Object get(Class clazz, Long productId); // // /** // * 保存对象 // * // * @param object // */ // void saveBean(Object object); // // /** // * 更新对象 // * // * @param object // */ // void updateBean(Object object); // // Connection getConnection() throws SQLException; // } // // Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // }
import java.sql.*; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.mango.jtt.dao.IMangoDao; import com.mango.jtt.po.Product;
/** * */ package com.mango.jtt.service; /** * @author HHL * * @date 2016年11月30日 */ @Service public class ProductServiceImpl implements IProductService { @Autowired private IMangoDao dao; /* (non-Javadoc) * @see com.mango.jtt.service.ProductService#getProductList() */ @Override
// Path: src/main/java/com/mango/jtt/dao/IMangoDao.java // public interface IMangoDao { // // /** // * 根据查询条件获取查询结果 // * @param querySql // * @param map 条件参数 // * @return // */ // List list(String querySql, Map<String, Object> map); // // /** // * 根据id获取对象 // * // * @param clazz // * @param productId // * @return // */ // Object get(Class clazz, Long productId); // // /** // * 保存对象 // * // * @param object // */ // void saveBean(Object object); // // /** // * 更新对象 // * // * @param object // */ // void updateBean(Object object); // // Connection getConnection() throws SQLException; // } // // Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // Path: src/main/java/com/mango/jtt/service/ProductServiceImpl.java import java.sql.*; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.mango.jtt.dao.IMangoDao; import com.mango.jtt.po.Product; /** * */ package com.mango.jtt.service; /** * @author HHL * * @date 2016年11月30日 */ @Service public class ProductServiceImpl implements IProductService { @Autowired private IMangoDao dao; /* (non-Javadoc) * @see com.mango.jtt.service.ProductService#getProductList() */ @Override
public List<Product> getProductList() {
honghailiang/SpringMango
src/main/java/com/mango/jtt/springSecurity/MyUserDetailsService.java
// Path: src/main/java/com/mango/jtt/po/MangoUser.java // @Entity // @Table(name = "mango_user") // public class MangoUser extends BaseBean { // // /** // * // */ // private static final long serialVersionUID = -9068362068362830589L; // /** // * 用户id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long userId; // /** // * 用户名称 // */ // private String userName; // /** // * 用户密码 // */ // private String password; // /** // * 用户角色 // */ // private String role; // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getPassword() { // return password; // } // // public void setPassword(String password) { // this.password = password; // } // // public String getRole() { // return role; // } // // public void setRole(String role) { // this.role = role; // } // } // // Path: src/main/java/com/mango/jtt/service/IUserService.java // public interface IUserService { // // public MangoUser getUserByName(String name); // // List<MangoUser> getUserList(); // // void saveUser(MangoUser mangoUser); // }
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import com.mango.jtt.po.MangoUser; import com.mango.jtt.service.IUserService;
package com.mango.jtt.springSecurity; /** * 从数据库中获取信息的自定义类 * * @author HHL * */ @Service public class MyUserDetailsService implements UserDetailsService { @Autowired
// Path: src/main/java/com/mango/jtt/po/MangoUser.java // @Entity // @Table(name = "mango_user") // public class MangoUser extends BaseBean { // // /** // * // */ // private static final long serialVersionUID = -9068362068362830589L; // /** // * 用户id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long userId; // /** // * 用户名称 // */ // private String userName; // /** // * 用户密码 // */ // private String password; // /** // * 用户角色 // */ // private String role; // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getPassword() { // return password; // } // // public void setPassword(String password) { // this.password = password; // } // // public String getRole() { // return role; // } // // public void setRole(String role) { // this.role = role; // } // } // // Path: src/main/java/com/mango/jtt/service/IUserService.java // public interface IUserService { // // public MangoUser getUserByName(String name); // // List<MangoUser> getUserList(); // // void saveUser(MangoUser mangoUser); // } // Path: src/main/java/com/mango/jtt/springSecurity/MyUserDetailsService.java import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import com.mango.jtt.po.MangoUser; import com.mango.jtt.service.IUserService; package com.mango.jtt.springSecurity; /** * 从数据库中获取信息的自定义类 * * @author HHL * */ @Service public class MyUserDetailsService implements UserDetailsService { @Autowired
private IUserService userService;
honghailiang/SpringMango
src/main/java/com/mango/jtt/springSecurity/MyUserDetailsService.java
// Path: src/main/java/com/mango/jtt/po/MangoUser.java // @Entity // @Table(name = "mango_user") // public class MangoUser extends BaseBean { // // /** // * // */ // private static final long serialVersionUID = -9068362068362830589L; // /** // * 用户id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long userId; // /** // * 用户名称 // */ // private String userName; // /** // * 用户密码 // */ // private String password; // /** // * 用户角色 // */ // private String role; // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getPassword() { // return password; // } // // public void setPassword(String password) { // this.password = password; // } // // public String getRole() { // return role; // } // // public void setRole(String role) { // this.role = role; // } // } // // Path: src/main/java/com/mango/jtt/service/IUserService.java // public interface IUserService { // // public MangoUser getUserByName(String name); // // List<MangoUser> getUserList(); // // void saveUser(MangoUser mangoUser); // }
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import com.mango.jtt.po.MangoUser; import com.mango.jtt.service.IUserService;
package com.mango.jtt.springSecurity; /** * 从数据库中获取信息的自定义类 * * @author HHL * */ @Service public class MyUserDetailsService implements UserDetailsService { @Autowired private IUserService userService; /** * 获取用户信息,设置角色 */ @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { // 获取用户信息
// Path: src/main/java/com/mango/jtt/po/MangoUser.java // @Entity // @Table(name = "mango_user") // public class MangoUser extends BaseBean { // // /** // * // */ // private static final long serialVersionUID = -9068362068362830589L; // /** // * 用户id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long userId; // /** // * 用户名称 // */ // private String userName; // /** // * 用户密码 // */ // private String password; // /** // * 用户角色 // */ // private String role; // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getPassword() { // return password; // } // // public void setPassword(String password) { // this.password = password; // } // // public String getRole() { // return role; // } // // public void setRole(String role) { // this.role = role; // } // } // // Path: src/main/java/com/mango/jtt/service/IUserService.java // public interface IUserService { // // public MangoUser getUserByName(String name); // // List<MangoUser> getUserList(); // // void saveUser(MangoUser mangoUser); // } // Path: src/main/java/com/mango/jtt/springSecurity/MyUserDetailsService.java import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import com.mango.jtt.po.MangoUser; import com.mango.jtt.service.IUserService; package com.mango.jtt.springSecurity; /** * 从数据库中获取信息的自定义类 * * @author HHL * */ @Service public class MyUserDetailsService implements UserDetailsService { @Autowired private IUserService userService; /** * 获取用户信息,设置角色 */ @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { // 获取用户信息
MangoUser mangoUser = userService.getUserByName(username);
honghailiang/SpringMango
src/test/java/com/mango/jtt/init/InitMangoTest.java
// Path: src/test/java/com/mango/jtt/BaseTest.java // @RunWith(SpringJUnit4ClassRunner.class) // @ContextConfiguration(locations = "classpath*:applicationContext*.xml") // @ActiveProfiles("dev") // public class BaseTest { // } // // Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // // Path: src/main/java/com/mango/jtt/service/IProductService.java // public interface IProductService { // /** // * 获取商品列表 // * // * @return // */ // List<Product> getProductList(); // // /** // * 根据商品id获取商品信息 // * // * @param productId // * @return // */ // Product getProductById(Long productId); // // /** // * 添加商品记录 // * @param product // */ // void saveProduct(Product product); // } // // Path: src/main/java/com/mango/jtt/service/IUserService.java // public interface IUserService { // // public MangoUser getUserByName(String name); // // List<MangoUser> getUserList(); // // void saveUser(MangoUser mangoUser); // }
import com.mango.jtt.BaseTest; import com.mango.jtt.po.Product; import com.mango.jtt.service.IProductService; import com.mango.jtt.service.IUserService; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull;
package com.mango.jtt.init; /** * InitMango Tester. * * @author <Authors name> * @version 1.0 * @since <pre>七月 13, 2017</pre> */ public class InitMangoTest extends BaseTest{ @Autowired
// Path: src/test/java/com/mango/jtt/BaseTest.java // @RunWith(SpringJUnit4ClassRunner.class) // @ContextConfiguration(locations = "classpath*:applicationContext*.xml") // @ActiveProfiles("dev") // public class BaseTest { // } // // Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // // Path: src/main/java/com/mango/jtt/service/IProductService.java // public interface IProductService { // /** // * 获取商品列表 // * // * @return // */ // List<Product> getProductList(); // // /** // * 根据商品id获取商品信息 // * // * @param productId // * @return // */ // Product getProductById(Long productId); // // /** // * 添加商品记录 // * @param product // */ // void saveProduct(Product product); // } // // Path: src/main/java/com/mango/jtt/service/IUserService.java // public interface IUserService { // // public MangoUser getUserByName(String name); // // List<MangoUser> getUserList(); // // void saveUser(MangoUser mangoUser); // } // Path: src/test/java/com/mango/jtt/init/InitMangoTest.java import com.mango.jtt.BaseTest; import com.mango.jtt.po.Product; import com.mango.jtt.service.IProductService; import com.mango.jtt.service.IUserService; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; package com.mango.jtt.init; /** * InitMango Tester. * * @author <Authors name> * @version 1.0 * @since <pre>七月 13, 2017</pre> */ public class InitMangoTest extends BaseTest{ @Autowired
private IProductService productService;
honghailiang/SpringMango
src/test/java/com/mango/jtt/init/InitMangoTest.java
// Path: src/test/java/com/mango/jtt/BaseTest.java // @RunWith(SpringJUnit4ClassRunner.class) // @ContextConfiguration(locations = "classpath*:applicationContext*.xml") // @ActiveProfiles("dev") // public class BaseTest { // } // // Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // // Path: src/main/java/com/mango/jtt/service/IProductService.java // public interface IProductService { // /** // * 获取商品列表 // * // * @return // */ // List<Product> getProductList(); // // /** // * 根据商品id获取商品信息 // * // * @param productId // * @return // */ // Product getProductById(Long productId); // // /** // * 添加商品记录 // * @param product // */ // void saveProduct(Product product); // } // // Path: src/main/java/com/mango/jtt/service/IUserService.java // public interface IUserService { // // public MangoUser getUserByName(String name); // // List<MangoUser> getUserList(); // // void saveUser(MangoUser mangoUser); // }
import com.mango.jtt.BaseTest; import com.mango.jtt.po.Product; import com.mango.jtt.service.IProductService; import com.mango.jtt.service.IUserService; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull;
package com.mango.jtt.init; /** * InitMango Tester. * * @author <Authors name> * @version 1.0 * @since <pre>七月 13, 2017</pre> */ public class InitMangoTest extends BaseTest{ @Autowired private IProductService productService; @Autowired
// Path: src/test/java/com/mango/jtt/BaseTest.java // @RunWith(SpringJUnit4ClassRunner.class) // @ContextConfiguration(locations = "classpath*:applicationContext*.xml") // @ActiveProfiles("dev") // public class BaseTest { // } // // Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // // Path: src/main/java/com/mango/jtt/service/IProductService.java // public interface IProductService { // /** // * 获取商品列表 // * // * @return // */ // List<Product> getProductList(); // // /** // * 根据商品id获取商品信息 // * // * @param productId // * @return // */ // Product getProductById(Long productId); // // /** // * 添加商品记录 // * @param product // */ // void saveProduct(Product product); // } // // Path: src/main/java/com/mango/jtt/service/IUserService.java // public interface IUserService { // // public MangoUser getUserByName(String name); // // List<MangoUser> getUserList(); // // void saveUser(MangoUser mangoUser); // } // Path: src/test/java/com/mango/jtt/init/InitMangoTest.java import com.mango.jtt.BaseTest; import com.mango.jtt.po.Product; import com.mango.jtt.service.IProductService; import com.mango.jtt.service.IUserService; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; package com.mango.jtt.init; /** * InitMango Tester. * * @author <Authors name> * @version 1.0 * @since <pre>七月 13, 2017</pre> */ public class InitMangoTest extends BaseTest{ @Autowired private IProductService productService; @Autowired
private IUserService userService;
honghailiang/SpringMango
src/test/java/com/mango/jtt/init/InitMangoTest.java
// Path: src/test/java/com/mango/jtt/BaseTest.java // @RunWith(SpringJUnit4ClassRunner.class) // @ContextConfiguration(locations = "classpath*:applicationContext*.xml") // @ActiveProfiles("dev") // public class BaseTest { // } // // Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // // Path: src/main/java/com/mango/jtt/service/IProductService.java // public interface IProductService { // /** // * 获取商品列表 // * // * @return // */ // List<Product> getProductList(); // // /** // * 根据商品id获取商品信息 // * // * @param productId // * @return // */ // Product getProductById(Long productId); // // /** // * 添加商品记录 // * @param product // */ // void saveProduct(Product product); // } // // Path: src/main/java/com/mango/jtt/service/IUserService.java // public interface IUserService { // // public MangoUser getUserByName(String name); // // List<MangoUser> getUserList(); // // void saveUser(MangoUser mangoUser); // }
import com.mango.jtt.BaseTest; import com.mango.jtt.po.Product; import com.mango.jtt.service.IProductService; import com.mango.jtt.service.IUserService; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull;
package com.mango.jtt.init; /** * InitMango Tester. * * @author <Authors name> * @version 1.0 * @since <pre>七月 13, 2017</pre> */ public class InitMangoTest extends BaseTest{ @Autowired private IProductService productService; @Autowired private IUserService userService; @Before public void before() throws Exception { } @After public void after() throws Exception { } /** * Method: init() */ @Test public void testInit() throws Exception { assertNotNull(productService); assertNotNull(userService);
// Path: src/test/java/com/mango/jtt/BaseTest.java // @RunWith(SpringJUnit4ClassRunner.class) // @ContextConfiguration(locations = "classpath*:applicationContext*.xml") // @ActiveProfiles("dev") // public class BaseTest { // } // // Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // // Path: src/main/java/com/mango/jtt/service/IProductService.java // public interface IProductService { // /** // * 获取商品列表 // * // * @return // */ // List<Product> getProductList(); // // /** // * 根据商品id获取商品信息 // * // * @param productId // * @return // */ // Product getProductById(Long productId); // // /** // * 添加商品记录 // * @param product // */ // void saveProduct(Product product); // } // // Path: src/main/java/com/mango/jtt/service/IUserService.java // public interface IUserService { // // public MangoUser getUserByName(String name); // // List<MangoUser> getUserList(); // // void saveUser(MangoUser mangoUser); // } // Path: src/test/java/com/mango/jtt/init/InitMangoTest.java import com.mango.jtt.BaseTest; import com.mango.jtt.po.Product; import com.mango.jtt.service.IProductService; import com.mango.jtt.service.IUserService; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; package com.mango.jtt.init; /** * InitMango Tester. * * @author <Authors name> * @version 1.0 * @since <pre>七月 13, 2017</pre> */ public class InitMangoTest extends BaseTest{ @Autowired private IProductService productService; @Autowired private IUserService userService; @Before public void before() throws Exception { } @After public void after() throws Exception { } /** * Method: init() */ @Test public void testInit() throws Exception { assertNotNull(productService); assertNotNull(userService);
List<Product> products = productService.getProductList();
honghailiang/SpringMango
src/test/java/com/mango/jtt/service/ProductServiceImplTest.java
// Path: src/test/java/com/mango/jtt/BaseTest.java // @RunWith(SpringJUnit4ClassRunner.class) // @ContextConfiguration(locations = "classpath*:applicationContext*.xml") // @ActiveProfiles("dev") // public class BaseTest { // } // // Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // }
import com.mango.jtt.BaseTest; import com.mango.jtt.po.Product; import org.junit.Test; import org.junit.Before; import org.junit.After; import org.springframework.beans.factory.annotation.Autowired; import java.util.List; import static org.junit.Assert.assertEquals;
package com.mango.jtt.service; /** * ProductServiceImpl Tester. * * @author <Authors name> * @version 1.0 * @since <pre>七月 14, 2017</pre> */ public class ProductServiceImplTest extends BaseTest { @Autowired private IProductService productService; @Before public void before() throws Exception { } @After public void after() throws Exception { } /** * Method: getProductList() */ @Test public void testGetProductList() throws Exception {
// Path: src/test/java/com/mango/jtt/BaseTest.java // @RunWith(SpringJUnit4ClassRunner.class) // @ContextConfiguration(locations = "classpath*:applicationContext*.xml") // @ActiveProfiles("dev") // public class BaseTest { // } // // Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // Path: src/test/java/com/mango/jtt/service/ProductServiceImplTest.java import com.mango.jtt.BaseTest; import com.mango.jtt.po.Product; import org.junit.Test; import org.junit.Before; import org.junit.After; import org.springframework.beans.factory.annotation.Autowired; import java.util.List; import static org.junit.Assert.assertEquals; package com.mango.jtt.service; /** * ProductServiceImpl Tester. * * @author <Authors name> * @version 1.0 * @since <pre>七月 14, 2017</pre> */ public class ProductServiceImplTest extends BaseTest { @Autowired private IProductService productService; @Before public void before() throws Exception { } @After public void after() throws Exception { } /** * Method: getProductList() */ @Test public void testGetProductList() throws Exception {
List<Product> products = productService.getProductList();
honghailiang/SpringMango
src/main/java/com/mango/jtt/springSecurity/MyAuthenticationSuccessHandler.java
// Path: src/main/java/com/mango/jtt/po/MangoUser.java // @Entity // @Table(name = "mango_user") // public class MangoUser extends BaseBean { // // /** // * // */ // private static final long serialVersionUID = -9068362068362830589L; // /** // * 用户id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long userId; // /** // * 用户名称 // */ // private String userName; // /** // * 用户密码 // */ // private String password; // /** // * 用户角色 // */ // private String role; // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getPassword() { // return password; // } // // public void setPassword(String password) { // this.password = password; // } // // public String getRole() { // return role; // } // // public void setRole(String role) { // this.role = role; // } // } // // Path: src/main/java/com/mango/jtt/service/IUserService.java // public interface IUserService { // // public MangoUser getUserByName(String name); // // List<MangoUser> getUserList(); // // void saveUser(MangoUser mangoUser); // }
import java.io.IOException; import java.util.Collection; import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; import org.springframework.security.web.savedrequest.HttpSessionRequestCache; import org.springframework.security.web.savedrequest.RequestCache; import org.springframework.security.web.savedrequest.SavedRequest; import com.mango.jtt.po.MangoUser; import com.mango.jtt.service.IUserService;
package com.mango.jtt.springSecurity; /** * 登录授权成功后操作控制,如果是直接点击登录的情况下,根据授权权限跳转不同页面; 否则跳转到原请求页面 * * @author HHL * @date * */ public class MyAuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler { private Map<String, String> authDispatcherMap; private RequestCache requestCache = new HttpSessionRequestCache(); @Autowired
// Path: src/main/java/com/mango/jtt/po/MangoUser.java // @Entity // @Table(name = "mango_user") // public class MangoUser extends BaseBean { // // /** // * // */ // private static final long serialVersionUID = -9068362068362830589L; // /** // * 用户id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long userId; // /** // * 用户名称 // */ // private String userName; // /** // * 用户密码 // */ // private String password; // /** // * 用户角色 // */ // private String role; // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getPassword() { // return password; // } // // public void setPassword(String password) { // this.password = password; // } // // public String getRole() { // return role; // } // // public void setRole(String role) { // this.role = role; // } // } // // Path: src/main/java/com/mango/jtt/service/IUserService.java // public interface IUserService { // // public MangoUser getUserByName(String name); // // List<MangoUser> getUserList(); // // void saveUser(MangoUser mangoUser); // } // Path: src/main/java/com/mango/jtt/springSecurity/MyAuthenticationSuccessHandler.java import java.io.IOException; import java.util.Collection; import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; import org.springframework.security.web.savedrequest.HttpSessionRequestCache; import org.springframework.security.web.savedrequest.RequestCache; import org.springframework.security.web.savedrequest.SavedRequest; import com.mango.jtt.po.MangoUser; import com.mango.jtt.service.IUserService; package com.mango.jtt.springSecurity; /** * 登录授权成功后操作控制,如果是直接点击登录的情况下,根据授权权限跳转不同页面; 否则跳转到原请求页面 * * @author HHL * @date * */ public class MyAuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler { private Map<String, String> authDispatcherMap; private RequestCache requestCache = new HttpSessionRequestCache(); @Autowired
private IUserService userService;
honghailiang/SpringMango
src/main/java/com/mango/jtt/springSecurity/MyAuthenticationSuccessHandler.java
// Path: src/main/java/com/mango/jtt/po/MangoUser.java // @Entity // @Table(name = "mango_user") // public class MangoUser extends BaseBean { // // /** // * // */ // private static final long serialVersionUID = -9068362068362830589L; // /** // * 用户id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long userId; // /** // * 用户名称 // */ // private String userName; // /** // * 用户密码 // */ // private String password; // /** // * 用户角色 // */ // private String role; // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getPassword() { // return password; // } // // public void setPassword(String password) { // this.password = password; // } // // public String getRole() { // return role; // } // // public void setRole(String role) { // this.role = role; // } // } // // Path: src/main/java/com/mango/jtt/service/IUserService.java // public interface IUserService { // // public MangoUser getUserByName(String name); // // List<MangoUser> getUserList(); // // void saveUser(MangoUser mangoUser); // }
import java.io.IOException; import java.util.Collection; import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; import org.springframework.security.web.savedrequest.HttpSessionRequestCache; import org.springframework.security.web.savedrequest.RequestCache; import org.springframework.security.web.savedrequest.SavedRequest; import com.mango.jtt.po.MangoUser; import com.mango.jtt.service.IUserService;
package com.mango.jtt.springSecurity; /** * 登录授权成功后操作控制,如果是直接点击登录的情况下,根据授权权限跳转不同页面; 否则跳转到原请求页面 * * @author HHL * @date * */ public class MyAuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler { private Map<String, String> authDispatcherMap; private RequestCache requestCache = new HttpSessionRequestCache(); @Autowired private IUserService userService; @Override public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { // 获取用户权限 Collection<? extends GrantedAuthority> authCollection = authentication .getAuthorities(); if (authCollection.isEmpty()) { return; } // 认证成功后,获取用户信息并添加到session中 UserDetails userDetails = (UserDetails) authentication.getPrincipal();
// Path: src/main/java/com/mango/jtt/po/MangoUser.java // @Entity // @Table(name = "mango_user") // public class MangoUser extends BaseBean { // // /** // * // */ // private static final long serialVersionUID = -9068362068362830589L; // /** // * 用户id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long userId; // /** // * 用户名称 // */ // private String userName; // /** // * 用户密码 // */ // private String password; // /** // * 用户角色 // */ // private String role; // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getPassword() { // return password; // } // // public void setPassword(String password) { // this.password = password; // } // // public String getRole() { // return role; // } // // public void setRole(String role) { // this.role = role; // } // } // // Path: src/main/java/com/mango/jtt/service/IUserService.java // public interface IUserService { // // public MangoUser getUserByName(String name); // // List<MangoUser> getUserList(); // // void saveUser(MangoUser mangoUser); // } // Path: src/main/java/com/mango/jtt/springSecurity/MyAuthenticationSuccessHandler.java import java.io.IOException; import java.util.Collection; import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; import org.springframework.security.web.savedrequest.HttpSessionRequestCache; import org.springframework.security.web.savedrequest.RequestCache; import org.springframework.security.web.savedrequest.SavedRequest; import com.mango.jtt.po.MangoUser; import com.mango.jtt.service.IUserService; package com.mango.jtt.springSecurity; /** * 登录授权成功后操作控制,如果是直接点击登录的情况下,根据授权权限跳转不同页面; 否则跳转到原请求页面 * * @author HHL * @date * */ public class MyAuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler { private Map<String, String> authDispatcherMap; private RequestCache requestCache = new HttpSessionRequestCache(); @Autowired private IUserService userService; @Override public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { // 获取用户权限 Collection<? extends GrantedAuthority> authCollection = authentication .getAuthorities(); if (authCollection.isEmpty()) { return; } // 认证成功后,获取用户信息并添加到session中 UserDetails userDetails = (UserDetails) authentication.getPrincipal();
MangoUser user = userService.getUserByName(userDetails.getUsername());
honghailiang/SpringMango
src/main/java/com/mango/jtt/service/UserServiceImpl.java
// Path: src/main/java/com/mango/jtt/dao/IMangoDao.java // public interface IMangoDao { // // /** // * 根据查询条件获取查询结果 // * @param querySql // * @param map 条件参数 // * @return // */ // List list(String querySql, Map<String, Object> map); // // /** // * 根据id获取对象 // * // * @param clazz // * @param productId // * @return // */ // Object get(Class clazz, Long productId); // // /** // * 保存对象 // * // * @param object // */ // void saveBean(Object object); // // /** // * 更新对象 // * // * @param object // */ // void updateBean(Object object); // // Connection getConnection() throws SQLException; // } // // Path: src/main/java/com/mango/jtt/po/MangoUser.java // @Entity // @Table(name = "mango_user") // public class MangoUser extends BaseBean { // // /** // * // */ // private static final long serialVersionUID = -9068362068362830589L; // /** // * 用户id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long userId; // /** // * 用户名称 // */ // private String userName; // /** // * 用户密码 // */ // private String password; // /** // * 用户角色 // */ // private String role; // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getPassword() { // return password; // } // // public void setPassword(String password) { // this.password = password; // } // // public String getRole() { // return role; // } // // public void setRole(String role) { // this.role = role; // } // }
import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.mango.jtt.dao.IMangoDao; import com.mango.jtt.po.MangoUser;
/** * */ package com.mango.jtt.service; /** * @author HHL * * @date 2016年12月8日 */ @Service public class UserServiceImpl implements IUserService { @Autowired
// Path: src/main/java/com/mango/jtt/dao/IMangoDao.java // public interface IMangoDao { // // /** // * 根据查询条件获取查询结果 // * @param querySql // * @param map 条件参数 // * @return // */ // List list(String querySql, Map<String, Object> map); // // /** // * 根据id获取对象 // * // * @param clazz // * @param productId // * @return // */ // Object get(Class clazz, Long productId); // // /** // * 保存对象 // * // * @param object // */ // void saveBean(Object object); // // /** // * 更新对象 // * // * @param object // */ // void updateBean(Object object); // // Connection getConnection() throws SQLException; // } // // Path: src/main/java/com/mango/jtt/po/MangoUser.java // @Entity // @Table(name = "mango_user") // public class MangoUser extends BaseBean { // // /** // * // */ // private static final long serialVersionUID = -9068362068362830589L; // /** // * 用户id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long userId; // /** // * 用户名称 // */ // private String userName; // /** // * 用户密码 // */ // private String password; // /** // * 用户角色 // */ // private String role; // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getPassword() { // return password; // } // // public void setPassword(String password) { // this.password = password; // } // // public String getRole() { // return role; // } // // public void setRole(String role) { // this.role = role; // } // } // Path: src/main/java/com/mango/jtt/service/UserServiceImpl.java import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.mango.jtt.dao.IMangoDao; import com.mango.jtt.po.MangoUser; /** * */ package com.mango.jtt.service; /** * @author HHL * * @date 2016年12月8日 */ @Service public class UserServiceImpl implements IUserService { @Autowired
private IMangoDao dao;
honghailiang/SpringMango
src/main/java/com/mango/jtt/service/UserServiceImpl.java
// Path: src/main/java/com/mango/jtt/dao/IMangoDao.java // public interface IMangoDao { // // /** // * 根据查询条件获取查询结果 // * @param querySql // * @param map 条件参数 // * @return // */ // List list(String querySql, Map<String, Object> map); // // /** // * 根据id获取对象 // * // * @param clazz // * @param productId // * @return // */ // Object get(Class clazz, Long productId); // // /** // * 保存对象 // * // * @param object // */ // void saveBean(Object object); // // /** // * 更新对象 // * // * @param object // */ // void updateBean(Object object); // // Connection getConnection() throws SQLException; // } // // Path: src/main/java/com/mango/jtt/po/MangoUser.java // @Entity // @Table(name = "mango_user") // public class MangoUser extends BaseBean { // // /** // * // */ // private static final long serialVersionUID = -9068362068362830589L; // /** // * 用户id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long userId; // /** // * 用户名称 // */ // private String userName; // /** // * 用户密码 // */ // private String password; // /** // * 用户角色 // */ // private String role; // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getPassword() { // return password; // } // // public void setPassword(String password) { // this.password = password; // } // // public String getRole() { // return role; // } // // public void setRole(String role) { // this.role = role; // } // }
import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.mango.jtt.dao.IMangoDao; import com.mango.jtt.po.MangoUser;
/** * */ package com.mango.jtt.service; /** * @author HHL * * @date 2016年12月8日 */ @Service public class UserServiceImpl implements IUserService { @Autowired private IMangoDao dao; /* (non-Javadoc) * @see com.mango.jtt.service.IUserService#getUserByName() */ @Override
// Path: src/main/java/com/mango/jtt/dao/IMangoDao.java // public interface IMangoDao { // // /** // * 根据查询条件获取查询结果 // * @param querySql // * @param map 条件参数 // * @return // */ // List list(String querySql, Map<String, Object> map); // // /** // * 根据id获取对象 // * // * @param clazz // * @param productId // * @return // */ // Object get(Class clazz, Long productId); // // /** // * 保存对象 // * // * @param object // */ // void saveBean(Object object); // // /** // * 更新对象 // * // * @param object // */ // void updateBean(Object object); // // Connection getConnection() throws SQLException; // } // // Path: src/main/java/com/mango/jtt/po/MangoUser.java // @Entity // @Table(name = "mango_user") // public class MangoUser extends BaseBean { // // /** // * // */ // private static final long serialVersionUID = -9068362068362830589L; // /** // * 用户id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long userId; // /** // * 用户名称 // */ // private String userName; // /** // * 用户密码 // */ // private String password; // /** // * 用户角色 // */ // private String role; // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getPassword() { // return password; // } // // public void setPassword(String password) { // this.password = password; // } // // public String getRole() { // return role; // } // // public void setRole(String role) { // this.role = role; // } // } // Path: src/main/java/com/mango/jtt/service/UserServiceImpl.java import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.mango.jtt.dao.IMangoDao; import com.mango.jtt.po.MangoUser; /** * */ package com.mango.jtt.service; /** * @author HHL * * @date 2016年12月8日 */ @Service public class UserServiceImpl implements IUserService { @Autowired private IMangoDao dao; /* (non-Javadoc) * @see com.mango.jtt.service.IUserService#getUserByName() */ @Override
public MangoUser getUserByName(String name) {
honghailiang/SpringMango
src/main/java/com/mango/jtt/springAspect/XmlAspect.java
// Path: src/main/java/com/mango/jtt/util/LogUtil.java // public class LogUtil { // // test日志 // public static Logger testLog = LoggerFactory.getLogger("test_logger"); // // public static boolean isPrintStackTrace = true; // // // 记录test错误日志信息 // public static void testLogError(String errorMessage, Exception ex) { // if (testLog != null) { // testLog.error(errorMessage); // } // // if (isPrintStackTrace && ex != null && testLog != null) { // testLog.error(ex.getMessage(), ex); // } // } // // public static void printInfoLog(Class<?> cla, String message) { // LoggerFactory.getLogger(cla).info(message); // } // }
import com.mango.jtt.util.LogUtil; import org.aspectj.lang.ProceedingJoinPoint; import org.springframework.core.Ordered;
/** * */ package com.mango.jtt.springAspect; /** * 基于xml的aop配置 * * @author HHL * * @date 2016年12月6日 */ public class XmlAspect implements Ordered { public void beforeGet() {
// Path: src/main/java/com/mango/jtt/util/LogUtil.java // public class LogUtil { // // test日志 // public static Logger testLog = LoggerFactory.getLogger("test_logger"); // // public static boolean isPrintStackTrace = true; // // // 记录test错误日志信息 // public static void testLogError(String errorMessage, Exception ex) { // if (testLog != null) { // testLog.error(errorMessage); // } // // if (isPrintStackTrace && ex != null && testLog != null) { // testLog.error(ex.getMessage(), ex); // } // } // // public static void printInfoLog(Class<?> cla, String message) { // LoggerFactory.getLogger(cla).info(message); // } // } // Path: src/main/java/com/mango/jtt/springAspect/XmlAspect.java import com.mango.jtt.util.LogUtil; import org.aspectj.lang.ProceedingJoinPoint; import org.springframework.core.Ordered; /** * */ package com.mango.jtt.springAspect; /** * 基于xml的aop配置 * * @author HHL * * @date 2016年12月6日 */ public class XmlAspect implements Ordered { public void beforeGet() {
LogUtil.printInfoLog(getClass(), "beforeGet");
honghailiang/SpringMango
src/main/java/com/mango/jtt/springAspect/LogAspect.java
// Path: src/main/java/com/mango/jtt/po/Order.java // @Entity // @Table(name = "omorder") // public class Order extends BaseBean { // // private static final long serialVersionUID = -8131973629927813366L; // /** // * 订单编号 // */ // @Id // private Long orderId; // /** // * 商品id // */ // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 购买数量 // */ // private int number; // // /** // * 订单总额 // */ // private double totalPrice; // // /** // * 创建时间 // */ // private String createTime; // /** // * 购买用户id // */ // private Long userId; // // /** // * 用户名称 // */ // private String userName; // /** // * 订单状态:0:未支付,1:已支付 // */ // private String status; // /** // * 支付时间 // */ // private String payTime; // /** // * 地址信息 // */ // @Embedded // private Address address; // // public Address getAddress() { // return address; // } // // public void setAddress(Address address) { // this.address = address; // } // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // // public String getProductName() { // return productName; // } // // public void setProductName(String productName) { // this.productName = productName; // } // // public double getUnitPrice() { // return unitPrice; // } // // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // // public int getNumber() { // return number; // } // // public void setNumber(int number) { // this.number = number; // } // // public double getTotalPrice() { // return totalPrice; // } // // public void setTotalPrice(double totalPrice) { // this.totalPrice = totalPrice; // } // // public Long getOrderId() { // return orderId; // } // // public void setOrderId(Long orderId) { // this.orderId = orderId; // } // // public String getCreateTime() { // return createTime; // } // // public void setCreateTime(String createTime) { // this.createTime = createTime; // } // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getStatus() { // return status; // } // // public void setStatus(String status) { // this.status = status; // } // // public String getPayTime() { // return payTime; // } // // public void setPayTime(String payTime) { // this.payTime = payTime; // } // } // // Path: src/main/java/com/mango/jtt/util/LogUtil.java // public class LogUtil { // // test日志 // public static Logger testLog = LoggerFactory.getLogger("test_logger"); // // public static boolean isPrintStackTrace = true; // // // 记录test错误日志信息 // public static void testLogError(String errorMessage, Exception ex) { // if (testLog != null) { // testLog.error(errorMessage); // } // // if (isPrintStackTrace && ex != null && testLog != null) { // testLog.error(ex.getMessage(), ex); // } // } // // public static void printInfoLog(Class<?> cla, String message) { // LoggerFactory.getLogger(cla).info(message); // } // }
import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.springframework.stereotype.Component; import com.mango.jtt.po.Order; import com.mango.jtt.util.LogUtil;
/** * */ package com.mango.jtt.springAspect; /** * 基于@AspectJ注解的aop配置 * * @author HHL * * @date 2016年10月25日 */ @Component @Aspect
// Path: src/main/java/com/mango/jtt/po/Order.java // @Entity // @Table(name = "omorder") // public class Order extends BaseBean { // // private static final long serialVersionUID = -8131973629927813366L; // /** // * 订单编号 // */ // @Id // private Long orderId; // /** // * 商品id // */ // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 购买数量 // */ // private int number; // // /** // * 订单总额 // */ // private double totalPrice; // // /** // * 创建时间 // */ // private String createTime; // /** // * 购买用户id // */ // private Long userId; // // /** // * 用户名称 // */ // private String userName; // /** // * 订单状态:0:未支付,1:已支付 // */ // private String status; // /** // * 支付时间 // */ // private String payTime; // /** // * 地址信息 // */ // @Embedded // private Address address; // // public Address getAddress() { // return address; // } // // public void setAddress(Address address) { // this.address = address; // } // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // // public String getProductName() { // return productName; // } // // public void setProductName(String productName) { // this.productName = productName; // } // // public double getUnitPrice() { // return unitPrice; // } // // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // // public int getNumber() { // return number; // } // // public void setNumber(int number) { // this.number = number; // } // // public double getTotalPrice() { // return totalPrice; // } // // public void setTotalPrice(double totalPrice) { // this.totalPrice = totalPrice; // } // // public Long getOrderId() { // return orderId; // } // // public void setOrderId(Long orderId) { // this.orderId = orderId; // } // // public String getCreateTime() { // return createTime; // } // // public void setCreateTime(String createTime) { // this.createTime = createTime; // } // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getStatus() { // return status; // } // // public void setStatus(String status) { // this.status = status; // } // // public String getPayTime() { // return payTime; // } // // public void setPayTime(String payTime) { // this.payTime = payTime; // } // } // // Path: src/main/java/com/mango/jtt/util/LogUtil.java // public class LogUtil { // // test日志 // public static Logger testLog = LoggerFactory.getLogger("test_logger"); // // public static boolean isPrintStackTrace = true; // // // 记录test错误日志信息 // public static void testLogError(String errorMessage, Exception ex) { // if (testLog != null) { // testLog.error(errorMessage); // } // // if (isPrintStackTrace && ex != null && testLog != null) { // testLog.error(ex.getMessage(), ex); // } // } // // public static void printInfoLog(Class<?> cla, String message) { // LoggerFactory.getLogger(cla).info(message); // } // } // Path: src/main/java/com/mango/jtt/springAspect/LogAspect.java import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.springframework.stereotype.Component; import com.mango.jtt.po.Order; import com.mango.jtt.util.LogUtil; /** * */ package com.mango.jtt.springAspect; /** * 基于@AspectJ注解的aop配置 * * @author HHL * * @date 2016年10月25日 */ @Component @Aspect
@org.springframework.core.annotation.Order(1)
honghailiang/SpringMango
src/main/java/com/mango/jtt/springAspect/LogAspect.java
// Path: src/main/java/com/mango/jtt/po/Order.java // @Entity // @Table(name = "omorder") // public class Order extends BaseBean { // // private static final long serialVersionUID = -8131973629927813366L; // /** // * 订单编号 // */ // @Id // private Long orderId; // /** // * 商品id // */ // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 购买数量 // */ // private int number; // // /** // * 订单总额 // */ // private double totalPrice; // // /** // * 创建时间 // */ // private String createTime; // /** // * 购买用户id // */ // private Long userId; // // /** // * 用户名称 // */ // private String userName; // /** // * 订单状态:0:未支付,1:已支付 // */ // private String status; // /** // * 支付时间 // */ // private String payTime; // /** // * 地址信息 // */ // @Embedded // private Address address; // // public Address getAddress() { // return address; // } // // public void setAddress(Address address) { // this.address = address; // } // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // // public String getProductName() { // return productName; // } // // public void setProductName(String productName) { // this.productName = productName; // } // // public double getUnitPrice() { // return unitPrice; // } // // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // // public int getNumber() { // return number; // } // // public void setNumber(int number) { // this.number = number; // } // // public double getTotalPrice() { // return totalPrice; // } // // public void setTotalPrice(double totalPrice) { // this.totalPrice = totalPrice; // } // // public Long getOrderId() { // return orderId; // } // // public void setOrderId(Long orderId) { // this.orderId = orderId; // } // // public String getCreateTime() { // return createTime; // } // // public void setCreateTime(String createTime) { // this.createTime = createTime; // } // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getStatus() { // return status; // } // // public void setStatus(String status) { // this.status = status; // } // // public String getPayTime() { // return payTime; // } // // public void setPayTime(String payTime) { // this.payTime = payTime; // } // } // // Path: src/main/java/com/mango/jtt/util/LogUtil.java // public class LogUtil { // // test日志 // public static Logger testLog = LoggerFactory.getLogger("test_logger"); // // public static boolean isPrintStackTrace = true; // // // 记录test错误日志信息 // public static void testLogError(String errorMessage, Exception ex) { // if (testLog != null) { // testLog.error(errorMessage); // } // // if (isPrintStackTrace && ex != null && testLog != null) { // testLog.error(ex.getMessage(), ex); // } // } // // public static void printInfoLog(Class<?> cla, String message) { // LoggerFactory.getLogger(cla).info(message); // } // }
import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.springframework.stereotype.Component; import com.mango.jtt.po.Order; import com.mango.jtt.util.LogUtil;
/** * */ package com.mango.jtt.springAspect; /** * 基于@AspectJ注解的aop配置 * * @author HHL * * @date 2016年10月25日 */ @Component @Aspect @org.springframework.core.annotation.Order(1) public class LogAspect { @AfterReturning("execution(* com.mango.jtt.springTask.TaskJob.job1(..))") public void logTaskJob() {
// Path: src/main/java/com/mango/jtt/po/Order.java // @Entity // @Table(name = "omorder") // public class Order extends BaseBean { // // private static final long serialVersionUID = -8131973629927813366L; // /** // * 订单编号 // */ // @Id // private Long orderId; // /** // * 商品id // */ // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 购买数量 // */ // private int number; // // /** // * 订单总额 // */ // private double totalPrice; // // /** // * 创建时间 // */ // private String createTime; // /** // * 购买用户id // */ // private Long userId; // // /** // * 用户名称 // */ // private String userName; // /** // * 订单状态:0:未支付,1:已支付 // */ // private String status; // /** // * 支付时间 // */ // private String payTime; // /** // * 地址信息 // */ // @Embedded // private Address address; // // public Address getAddress() { // return address; // } // // public void setAddress(Address address) { // this.address = address; // } // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // // public String getProductName() { // return productName; // } // // public void setProductName(String productName) { // this.productName = productName; // } // // public double getUnitPrice() { // return unitPrice; // } // // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // // public int getNumber() { // return number; // } // // public void setNumber(int number) { // this.number = number; // } // // public double getTotalPrice() { // return totalPrice; // } // // public void setTotalPrice(double totalPrice) { // this.totalPrice = totalPrice; // } // // public Long getOrderId() { // return orderId; // } // // public void setOrderId(Long orderId) { // this.orderId = orderId; // } // // public String getCreateTime() { // return createTime; // } // // public void setCreateTime(String createTime) { // this.createTime = createTime; // } // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getStatus() { // return status; // } // // public void setStatus(String status) { // this.status = status; // } // // public String getPayTime() { // return payTime; // } // // public void setPayTime(String payTime) { // this.payTime = payTime; // } // } // // Path: src/main/java/com/mango/jtt/util/LogUtil.java // public class LogUtil { // // test日志 // public static Logger testLog = LoggerFactory.getLogger("test_logger"); // // public static boolean isPrintStackTrace = true; // // // 记录test错误日志信息 // public static void testLogError(String errorMessage, Exception ex) { // if (testLog != null) { // testLog.error(errorMessage); // } // // if (isPrintStackTrace && ex != null && testLog != null) { // testLog.error(ex.getMessage(), ex); // } // } // // public static void printInfoLog(Class<?> cla, String message) { // LoggerFactory.getLogger(cla).info(message); // } // } // Path: src/main/java/com/mango/jtt/springAspect/LogAspect.java import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.springframework.stereotype.Component; import com.mango.jtt.po.Order; import com.mango.jtt.util.LogUtil; /** * */ package com.mango.jtt.springAspect; /** * 基于@AspectJ注解的aop配置 * * @author HHL * * @date 2016年10月25日 */ @Component @Aspect @org.springframework.core.annotation.Order(1) public class LogAspect { @AfterReturning("execution(* com.mango.jtt.springTask.TaskJob.job1(..))") public void logTaskJob() {
LogUtil.printInfoLog(getClass(), "任务进行中ing......");
honghailiang/SpringMango
src/main/java/com/mango/jtt/controller/ProductController.java
// Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // // Path: src/main/java/com/mango/jtt/service/IProductService.java // public interface IProductService { // /** // * 获取商品列表 // * // * @return // */ // List<Product> getProductList(); // // /** // * 根据商品id获取商品信息 // * // * @param productId // * @return // */ // Product getProductById(Long productId); // // /** // * 添加商品记录 // * @param product // */ // void saveProduct(Product product); // }
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import com.mango.jtt.po.Product; import com.mango.jtt.service.IProductService;
/** * */ package com.mango.jtt.controller; /** * @author HHL * * @date 2016年11月30日 */ @Controller public class ProductController { @Autowired
// Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // // Path: src/main/java/com/mango/jtt/service/IProductService.java // public interface IProductService { // /** // * 获取商品列表 // * // * @return // */ // List<Product> getProductList(); // // /** // * 根据商品id获取商品信息 // * // * @param productId // * @return // */ // Product getProductById(Long productId); // // /** // * 添加商品记录 // * @param product // */ // void saveProduct(Product product); // } // Path: src/main/java/com/mango/jtt/controller/ProductController.java import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import com.mango.jtt.po.Product; import com.mango.jtt.service.IProductService; /** * */ package com.mango.jtt.controller; /** * @author HHL * * @date 2016年11月30日 */ @Controller public class ProductController { @Autowired
private IProductService productService;
honghailiang/SpringMango
src/main/java/com/mango/jtt/controller/ProductController.java
// Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // // Path: src/main/java/com/mango/jtt/service/IProductService.java // public interface IProductService { // /** // * 获取商品列表 // * // * @return // */ // List<Product> getProductList(); // // /** // * 根据商品id获取商品信息 // * // * @param productId // * @return // */ // Product getProductById(Long productId); // // /** // * 添加商品记录 // * @param product // */ // void saveProduct(Product product); // }
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import com.mango.jtt.po.Product; import com.mango.jtt.service.IProductService;
/** * */ package com.mango.jtt.controller; /** * @author HHL * * @date 2016年11月30日 */ @Controller public class ProductController { @Autowired private IProductService productService; @RequestMapping("/product/{productId}") public String getProductById(Model model, @PathVariable Long productId) {
// Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // // Path: src/main/java/com/mango/jtt/service/IProductService.java // public interface IProductService { // /** // * 获取商品列表 // * // * @return // */ // List<Product> getProductList(); // // /** // * 根据商品id获取商品信息 // * // * @param productId // * @return // */ // Product getProductById(Long productId); // // /** // * 添加商品记录 // * @param product // */ // void saveProduct(Product product); // } // Path: src/main/java/com/mango/jtt/controller/ProductController.java import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import com.mango.jtt.po.Product; import com.mango.jtt.service.IProductService; /** * */ package com.mango.jtt.controller; /** * @author HHL * * @date 2016年11月30日 */ @Controller public class ProductController { @Autowired private IProductService productService; @RequestMapping("/product/{productId}") public String getProductById(Model model, @PathVariable Long productId) {
Product product = productService.getProductById(productId);
honghailiang/SpringMango
src/main/java/com/mango/jtt/service/OrderServiceImpl.java
// Path: src/main/java/com/mango/jtt/dao/IMangoDao.java // public interface IMangoDao { // // /** // * 根据查询条件获取查询结果 // * @param querySql // * @param map 条件参数 // * @return // */ // List list(String querySql, Map<String, Object> map); // // /** // * 根据id获取对象 // * // * @param clazz // * @param productId // * @return // */ // Object get(Class clazz, Long productId); // // /** // * 保存对象 // * // * @param object // */ // void saveBean(Object object); // // /** // * 更新对象 // * // * @param object // */ // void updateBean(Object object); // // Connection getConnection() throws SQLException; // } // // Path: src/main/java/com/mango/jtt/po/Order.java // @Entity // @Table(name = "omorder") // public class Order extends BaseBean { // // private static final long serialVersionUID = -8131973629927813366L; // /** // * 订单编号 // */ // @Id // private Long orderId; // /** // * 商品id // */ // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 购买数量 // */ // private int number; // // /** // * 订单总额 // */ // private double totalPrice; // // /** // * 创建时间 // */ // private String createTime; // /** // * 购买用户id // */ // private Long userId; // // /** // * 用户名称 // */ // private String userName; // /** // * 订单状态:0:未支付,1:已支付 // */ // private String status; // /** // * 支付时间 // */ // private String payTime; // /** // * 地址信息 // */ // @Embedded // private Address address; // // public Address getAddress() { // return address; // } // // public void setAddress(Address address) { // this.address = address; // } // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // // public String getProductName() { // return productName; // } // // public void setProductName(String productName) { // this.productName = productName; // } // // public double getUnitPrice() { // return unitPrice; // } // // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // // public int getNumber() { // return number; // } // // public void setNumber(int number) { // this.number = number; // } // // public double getTotalPrice() { // return totalPrice; // } // // public void setTotalPrice(double totalPrice) { // this.totalPrice = totalPrice; // } // // public Long getOrderId() { // return orderId; // } // // public void setOrderId(Long orderId) { // this.orderId = orderId; // } // // public String getCreateTime() { // return createTime; // } // // public void setCreateTime(String createTime) { // this.createTime = createTime; // } // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getStatus() { // return status; // } // // public void setStatus(String status) { // this.status = status; // } // // public String getPayTime() { // return payTime; // } // // public void setPayTime(String payTime) { // this.payTime = payTime; // } // }
import com.mango.jtt.dao.IMangoDao; import com.mango.jtt.po.Order; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;
/** * */ package com.mango.jtt.service; /** * @author HHL * * @date 2016年12月1日 */ @Service public class OrderServiceImpl implements IOrderService { @Autowired
// Path: src/main/java/com/mango/jtt/dao/IMangoDao.java // public interface IMangoDao { // // /** // * 根据查询条件获取查询结果 // * @param querySql // * @param map 条件参数 // * @return // */ // List list(String querySql, Map<String, Object> map); // // /** // * 根据id获取对象 // * // * @param clazz // * @param productId // * @return // */ // Object get(Class clazz, Long productId); // // /** // * 保存对象 // * // * @param object // */ // void saveBean(Object object); // // /** // * 更新对象 // * // * @param object // */ // void updateBean(Object object); // // Connection getConnection() throws SQLException; // } // // Path: src/main/java/com/mango/jtt/po/Order.java // @Entity // @Table(name = "omorder") // public class Order extends BaseBean { // // private static final long serialVersionUID = -8131973629927813366L; // /** // * 订单编号 // */ // @Id // private Long orderId; // /** // * 商品id // */ // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 购买数量 // */ // private int number; // // /** // * 订单总额 // */ // private double totalPrice; // // /** // * 创建时间 // */ // private String createTime; // /** // * 购买用户id // */ // private Long userId; // // /** // * 用户名称 // */ // private String userName; // /** // * 订单状态:0:未支付,1:已支付 // */ // private String status; // /** // * 支付时间 // */ // private String payTime; // /** // * 地址信息 // */ // @Embedded // private Address address; // // public Address getAddress() { // return address; // } // // public void setAddress(Address address) { // this.address = address; // } // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // // public String getProductName() { // return productName; // } // // public void setProductName(String productName) { // this.productName = productName; // } // // public double getUnitPrice() { // return unitPrice; // } // // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // // public int getNumber() { // return number; // } // // public void setNumber(int number) { // this.number = number; // } // // public double getTotalPrice() { // return totalPrice; // } // // public void setTotalPrice(double totalPrice) { // this.totalPrice = totalPrice; // } // // public Long getOrderId() { // return orderId; // } // // public void setOrderId(Long orderId) { // this.orderId = orderId; // } // // public String getCreateTime() { // return createTime; // } // // public void setCreateTime(String createTime) { // this.createTime = createTime; // } // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getStatus() { // return status; // } // // public void setStatus(String status) { // this.status = status; // } // // public String getPayTime() { // return payTime; // } // // public void setPayTime(String payTime) { // this.payTime = payTime; // } // } // Path: src/main/java/com/mango/jtt/service/OrderServiceImpl.java import com.mango.jtt.dao.IMangoDao; import com.mango.jtt.po.Order; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * */ package com.mango.jtt.service; /** * @author HHL * * @date 2016年12月1日 */ @Service public class OrderServiceImpl implements IOrderService { @Autowired
private IMangoDao dao;
honghailiang/SpringMango
src/main/java/com/mango/jtt/service/OrderServiceImpl.java
// Path: src/main/java/com/mango/jtt/dao/IMangoDao.java // public interface IMangoDao { // // /** // * 根据查询条件获取查询结果 // * @param querySql // * @param map 条件参数 // * @return // */ // List list(String querySql, Map<String, Object> map); // // /** // * 根据id获取对象 // * // * @param clazz // * @param productId // * @return // */ // Object get(Class clazz, Long productId); // // /** // * 保存对象 // * // * @param object // */ // void saveBean(Object object); // // /** // * 更新对象 // * // * @param object // */ // void updateBean(Object object); // // Connection getConnection() throws SQLException; // } // // Path: src/main/java/com/mango/jtt/po/Order.java // @Entity // @Table(name = "omorder") // public class Order extends BaseBean { // // private static final long serialVersionUID = -8131973629927813366L; // /** // * 订单编号 // */ // @Id // private Long orderId; // /** // * 商品id // */ // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 购买数量 // */ // private int number; // // /** // * 订单总额 // */ // private double totalPrice; // // /** // * 创建时间 // */ // private String createTime; // /** // * 购买用户id // */ // private Long userId; // // /** // * 用户名称 // */ // private String userName; // /** // * 订单状态:0:未支付,1:已支付 // */ // private String status; // /** // * 支付时间 // */ // private String payTime; // /** // * 地址信息 // */ // @Embedded // private Address address; // // public Address getAddress() { // return address; // } // // public void setAddress(Address address) { // this.address = address; // } // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // // public String getProductName() { // return productName; // } // // public void setProductName(String productName) { // this.productName = productName; // } // // public double getUnitPrice() { // return unitPrice; // } // // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // // public int getNumber() { // return number; // } // // public void setNumber(int number) { // this.number = number; // } // // public double getTotalPrice() { // return totalPrice; // } // // public void setTotalPrice(double totalPrice) { // this.totalPrice = totalPrice; // } // // public Long getOrderId() { // return orderId; // } // // public void setOrderId(Long orderId) { // this.orderId = orderId; // } // // public String getCreateTime() { // return createTime; // } // // public void setCreateTime(String createTime) { // this.createTime = createTime; // } // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getStatus() { // return status; // } // // public void setStatus(String status) { // this.status = status; // } // // public String getPayTime() { // return payTime; // } // // public void setPayTime(String payTime) { // this.payTime = payTime; // } // }
import com.mango.jtt.dao.IMangoDao; import com.mango.jtt.po.Order; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;
/** * */ package com.mango.jtt.service; /** * @author HHL * * @date 2016年12月1日 */ @Service public class OrderServiceImpl implements IOrderService { @Autowired private IMangoDao dao; /* (non-Javadoc) * @see com.mango.jtt.service.IOrderService#addOrder(com.mango.jtt.po.Order) */ @Override
// Path: src/main/java/com/mango/jtt/dao/IMangoDao.java // public interface IMangoDao { // // /** // * 根据查询条件获取查询结果 // * @param querySql // * @param map 条件参数 // * @return // */ // List list(String querySql, Map<String, Object> map); // // /** // * 根据id获取对象 // * // * @param clazz // * @param productId // * @return // */ // Object get(Class clazz, Long productId); // // /** // * 保存对象 // * // * @param object // */ // void saveBean(Object object); // // /** // * 更新对象 // * // * @param object // */ // void updateBean(Object object); // // Connection getConnection() throws SQLException; // } // // Path: src/main/java/com/mango/jtt/po/Order.java // @Entity // @Table(name = "omorder") // public class Order extends BaseBean { // // private static final long serialVersionUID = -8131973629927813366L; // /** // * 订单编号 // */ // @Id // private Long orderId; // /** // * 商品id // */ // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 购买数量 // */ // private int number; // // /** // * 订单总额 // */ // private double totalPrice; // // /** // * 创建时间 // */ // private String createTime; // /** // * 购买用户id // */ // private Long userId; // // /** // * 用户名称 // */ // private String userName; // /** // * 订单状态:0:未支付,1:已支付 // */ // private String status; // /** // * 支付时间 // */ // private String payTime; // /** // * 地址信息 // */ // @Embedded // private Address address; // // public Address getAddress() { // return address; // } // // public void setAddress(Address address) { // this.address = address; // } // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // // public String getProductName() { // return productName; // } // // public void setProductName(String productName) { // this.productName = productName; // } // // public double getUnitPrice() { // return unitPrice; // } // // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // // public int getNumber() { // return number; // } // // public void setNumber(int number) { // this.number = number; // } // // public double getTotalPrice() { // return totalPrice; // } // // public void setTotalPrice(double totalPrice) { // this.totalPrice = totalPrice; // } // // public Long getOrderId() { // return orderId; // } // // public void setOrderId(Long orderId) { // this.orderId = orderId; // } // // public String getCreateTime() { // return createTime; // } // // public void setCreateTime(String createTime) { // this.createTime = createTime; // } // // public Long getUserId() { // return userId; // } // // public void setUserId(Long userId) { // this.userId = userId; // } // // public String getUserName() { // return userName; // } // // public void setUserName(String userName) { // this.userName = userName; // } // // public String getStatus() { // return status; // } // // public void setStatus(String status) { // this.status = status; // } // // public String getPayTime() { // return payTime; // } // // public void setPayTime(String payTime) { // this.payTime = payTime; // } // } // Path: src/main/java/com/mango/jtt/service/OrderServiceImpl.java import com.mango.jtt.dao.IMangoDao; import com.mango.jtt.po.Order; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * */ package com.mango.jtt.service; /** * @author HHL * * @date 2016年12月1日 */ @Service public class OrderServiceImpl implements IOrderService { @Autowired private IMangoDao dao; /* (non-Javadoc) * @see com.mango.jtt.service.IOrderService#addOrder(com.mango.jtt.po.Order) */ @Override
public void saveOrder(Order order) {
honghailiang/SpringMango
src/main/java/com/mango/jtt/controller/PageController.java
// Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // // Path: src/main/java/com/mango/jtt/service/IProductService.java // public interface IProductService { // /** // * 获取商品列表 // * // * @return // */ // List<Product> getProductList(); // // /** // * 根据商品id获取商品信息 // * // * @param productId // * @return // */ // Product getProductById(Long productId); // // /** // * 添加商品记录 // * @param product // */ // void saveProduct(Product product); // }
import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import com.mango.jtt.po.Product; import com.mango.jtt.service.IProductService;
/** * */ package com.mango.jtt.controller; /** * 页面处理器 * * @author HHL * * @date 2016年11月22日 */ @Controller public class PageController { @Autowired
// Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // // Path: src/main/java/com/mango/jtt/service/IProductService.java // public interface IProductService { // /** // * 获取商品列表 // * // * @return // */ // List<Product> getProductList(); // // /** // * 根据商品id获取商品信息 // * // * @param productId // * @return // */ // Product getProductById(Long productId); // // /** // * 添加商品记录 // * @param product // */ // void saveProduct(Product product); // } // Path: src/main/java/com/mango/jtt/controller/PageController.java import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import com.mango.jtt.po.Product; import com.mango.jtt.service.IProductService; /** * */ package com.mango.jtt.controller; /** * 页面处理器 * * @author HHL * * @date 2016年11月22日 */ @Controller public class PageController { @Autowired
private IProductService productService;
honghailiang/SpringMango
src/main/java/com/mango/jtt/controller/PageController.java
// Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // // Path: src/main/java/com/mango/jtt/service/IProductService.java // public interface IProductService { // /** // * 获取商品列表 // * // * @return // */ // List<Product> getProductList(); // // /** // * 根据商品id获取商品信息 // * // * @param productId // * @return // */ // Product getProductById(Long productId); // // /** // * 添加商品记录 // * @param product // */ // void saveProduct(Product product); // }
import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import com.mango.jtt.po.Product; import com.mango.jtt.service.IProductService;
/** * */ package com.mango.jtt.controller; /** * 页面处理器 * * @author HHL * * @date 2016年11月22日 */ @Controller public class PageController { @Autowired private IProductService productService; /** * 首页 映射/和/index路径 * * @return * @throws Exception */ @RequestMapping({ "/", "/index" }) public String index(Model model) throws Exception {
// Path: src/main/java/com/mango/jtt/po/Product.java // @Entity // @Table(name = "product") // public class Product extends BaseBean { // /** // * // */ // private static final long serialVersionUID = 3844317879498218112L; // // /** // * 商品id // */ // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long productId; // /** // * 商品名称 // */ // private String productName; // /** // * 商品单价 // */ // private double unitPrice; // /** // * 库存 // */ // private double quantity; // /** // * 单位 // */ // private String unit; // /** // * 商品图片地址 // */ // private String picture; // // public Long getProductId() { // return productId; // } // // public void setProductId(Long productId) { // this.productId = productId; // } // public double getQuantity() { // return quantity; // } // public void setQuantity(double quantity) { // this.quantity = quantity; // } // public String getProductName() { // return productName; // } // public void setProductName(String productName) { // this.productName = productName; // } // public double getUnitPrice() { // return unitPrice; // } // public void setUnitPrice(double unitPrice) { // this.unitPrice = unitPrice; // } // public String getUnit() { // return unit; // } // public void setUnit(String unit) { // this.unit = unit; // } // public String getPicture() { // return picture; // } // public void setPicture(String picture) { // this.picture = picture; // } // // } // // Path: src/main/java/com/mango/jtt/service/IProductService.java // public interface IProductService { // /** // * 获取商品列表 // * // * @return // */ // List<Product> getProductList(); // // /** // * 根据商品id获取商品信息 // * // * @param productId // * @return // */ // Product getProductById(Long productId); // // /** // * 添加商品记录 // * @param product // */ // void saveProduct(Product product); // } // Path: src/main/java/com/mango/jtt/controller/PageController.java import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import com.mango.jtt.po.Product; import com.mango.jtt.service.IProductService; /** * */ package com.mango.jtt.controller; /** * 页面处理器 * * @author HHL * * @date 2016年11月22日 */ @Controller public class PageController { @Autowired private IProductService productService; /** * 首页 映射/和/index路径 * * @return * @throws Exception */ @RequestMapping({ "/", "/index" }) public String index(Model model) throws Exception {
List<Product> productList = productService.getProductList();
honghailiang/SpringMango
src/main/java/com/mango/jtt/init/InitMango.java
// Path: src/main/java/com/mango/jtt/servlet/InitService.java // @Service // public class InitService { // @Autowired // private IProductService productService; // @Autowired // private IUserService userService; // // public void setProductAndUser() { // List<Product> products = productService.getProductList(); // if (null == products || products.isEmpty()){ // Product product = new Product(); // product.setProductName("Mango"); // product.setQuantity(100); // product.setUnit("个"); // product.setUnitPrice(100); // productService.saveProduct(product); // } // // //库中没有用户则添加普通用户和管理员用户 // List<MangoUser> mangoUsers = userService.getUserList(); // if(null == mangoUsers || mangoUsers.isEmpty()){ // MangoUser mangoUser = new MangoUser(); // mangoUser.setUserName("mango"); // mangoUser.setPassword(StringUtil.md5("123456")); // mangoUser.setRole("ROLE_USER"); // userService.saveUser(mangoUser); // // MangoUser mangoUser1 = new MangoUser(); // mangoUser1.setUserName("manager"); // mangoUser1.setPassword(StringUtil.md5("123456")); // mangoUser1.setRole("ROLE_MANAGER"); // userService.saveUser(mangoUser1); // } // } // }
import com.mango.jtt.servlet.InitService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct;
package com.mango.jtt.init; /** * Created by Administrator on 2017/6/15. * spring容器启动后,bean初始化时会调用,初始化数据(产生一个默认商品、普通用户和管理员用户) */ @Component public class InitMango{ @Autowired
// Path: src/main/java/com/mango/jtt/servlet/InitService.java // @Service // public class InitService { // @Autowired // private IProductService productService; // @Autowired // private IUserService userService; // // public void setProductAndUser() { // List<Product> products = productService.getProductList(); // if (null == products || products.isEmpty()){ // Product product = new Product(); // product.setProductName("Mango"); // product.setQuantity(100); // product.setUnit("个"); // product.setUnitPrice(100); // productService.saveProduct(product); // } // // //库中没有用户则添加普通用户和管理员用户 // List<MangoUser> mangoUsers = userService.getUserList(); // if(null == mangoUsers || mangoUsers.isEmpty()){ // MangoUser mangoUser = new MangoUser(); // mangoUser.setUserName("mango"); // mangoUser.setPassword(StringUtil.md5("123456")); // mangoUser.setRole("ROLE_USER"); // userService.saveUser(mangoUser); // // MangoUser mangoUser1 = new MangoUser(); // mangoUser1.setUserName("manager"); // mangoUser1.setPassword(StringUtil.md5("123456")); // mangoUser1.setRole("ROLE_MANAGER"); // userService.saveUser(mangoUser1); // } // } // } // Path: src/main/java/com/mango/jtt/init/InitMango.java import com.mango.jtt.servlet.InitService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; package com.mango.jtt.init; /** * Created by Administrator on 2017/6/15. * spring容器启动后,bean初始化时会调用,初始化数据(产生一个默认商品、普通用户和管理员用户) */ @Component public class InitMango{ @Autowired
private InitService initService;
un0btanium/FactorioScript
src/main/java/entities/compiler/StatementAdd.java
// Path: src/main/java/entities/blueprint/Entity.java // @JsonIgnoreProperties(ignoreUnknown = true) // public class Entity implements FactorioEntity { // // private static int entity_id = 0; // // public int entity_number; // public String name; // public Position position; // public int direction; // public ControlBehavior control_behavior; // public HashMap<String, Connection> connections; // // public Entity(String name) { // this.entity_number = entity_id++; // this.name = name; // } // // // /** // * Connects the entity with the entity associated with the given id. // * @param circuitId if the wire should start at the input or output // * @param color the wire color // * @param entityId the entity to connect to // * @param circuitIdDestination connect to the input or output of the entity // */ // public void addConnection(String circuitId, String color, int entityId, int circuitIdDestination) { // if (connections == null) // connections = new HashMap<>(); // if (!connections.containsKey(circuitId)) // connections.put(circuitId, new Connection()); // if (color.equals("green")) { // if (connections.get(circuitId).green == null) // connections.get(circuitId).green = new ArrayList<>(); // connections.get(circuitId).green.add(new ConnectionDetail(entityId, circuitIdDestination)); // } else if (color.equals("red")) { // if (connections.get(circuitId).red == null) // connections.get(circuitId).red = new ArrayList<>(); // connections.get(circuitId).red.add(new ConnectionDetail(entityId, circuitIdDestination)); // } // } // // }
import entities.blueprint.Entity;
package entities.compiler; public class StatementAdd implements Statement { private Variable variable; private CompilerEntity expression; public StatementAdd(Variable variable, CompilerEntity expression) { this.variable = variable; this.expression = expression; } @Override public void getEntities(EntityGatherer eg) { ArithmeticCombinator acEach = new ArithmeticCombinator(); acEach.leftEntity = new Variable("signal-each"); acEach.operation = "+"; acEach.rightEntity = new Number(0); acEach.outputSignal = "signal-each";
// Path: src/main/java/entities/blueprint/Entity.java // @JsonIgnoreProperties(ignoreUnknown = true) // public class Entity implements FactorioEntity { // // private static int entity_id = 0; // // public int entity_number; // public String name; // public Position position; // public int direction; // public ControlBehavior control_behavior; // public HashMap<String, Connection> connections; // // public Entity(String name) { // this.entity_number = entity_id++; // this.name = name; // } // // // /** // * Connects the entity with the entity associated with the given id. // * @param circuitId if the wire should start at the input or output // * @param color the wire color // * @param entityId the entity to connect to // * @param circuitIdDestination connect to the input or output of the entity // */ // public void addConnection(String circuitId, String color, int entityId, int circuitIdDestination) { // if (connections == null) // connections = new HashMap<>(); // if (!connections.containsKey(circuitId)) // connections.put(circuitId, new Connection()); // if (color.equals("green")) { // if (connections.get(circuitId).green == null) // connections.get(circuitId).green = new ArrayList<>(); // connections.get(circuitId).green.add(new ConnectionDetail(entityId, circuitIdDestination)); // } else if (color.equals("red")) { // if (connections.get(circuitId).red == null) // connections.get(circuitId).red = new ArrayList<>(); // connections.get(circuitId).red.add(new ConnectionDetail(entityId, circuitIdDestination)); // } // } // // } // Path: src/main/java/entities/compiler/StatementAdd.java import entities.blueprint.Entity; package entities.compiler; public class StatementAdd implements Statement { private Variable variable; private CompilerEntity expression; public StatementAdd(Variable variable, CompilerEntity expression) { this.variable = variable; this.expression = expression; } @Override public void getEntities(EntityGatherer eg) { ArithmeticCombinator acEach = new ArithmeticCombinator(); acEach.leftEntity = new Variable("signal-each"); acEach.operation = "+"; acEach.rightEntity = new Number(0); acEach.outputSignal = "signal-each";
Entity entityAcEach = acEach.getEntity(0, eg.offsetY);
un0btanium/FactorioScript
src/main/java/entities/compiler/EntityGatherer.java
// Path: src/main/java/entities/blueprint/Entity.java // @JsonIgnoreProperties(ignoreUnknown = true) // public class Entity implements FactorioEntity { // // private static int entity_id = 0; // // public int entity_number; // public String name; // public Position position; // public int direction; // public ControlBehavior control_behavior; // public HashMap<String, Connection> connections; // // public Entity(String name) { // this.entity_number = entity_id++; // this.name = name; // } // // // /** // * Connects the entity with the entity associated with the given id. // * @param circuitId if the wire should start at the input or output // * @param color the wire color // * @param entityId the entity to connect to // * @param circuitIdDestination connect to the input or output of the entity // */ // public void addConnection(String circuitId, String color, int entityId, int circuitIdDestination) { // if (connections == null) // connections = new HashMap<>(); // if (!connections.containsKey(circuitId)) // connections.put(circuitId, new Connection()); // if (color.equals("green")) { // if (connections.get(circuitId).green == null) // connections.get(circuitId).green = new ArrayList<>(); // connections.get(circuitId).green.add(new ConnectionDetail(entityId, circuitIdDestination)); // } else if (color.equals("red")) { // if (connections.get(circuitId).red == null) // connections.get(circuitId).red = new ArrayList<>(); // connections.get(circuitId).red.add(new ConnectionDetail(entityId, circuitIdDestination)); // } // } // // } // // Path: src/main/java/entities/blueprint/Position.java // @JsonIgnoreProperties(ignoreUnknown = true) // public class Position { // // public double x; // public double y; // // public Position(double x, double y) { // this.x = x; // this.y = y; // } // }
import java.util.ArrayList; import entities.blueprint.Entity; import entities.blueprint.Position;
package entities.compiler; public class EntityGatherer { public int offsetX; public int offsetY;
// Path: src/main/java/entities/blueprint/Entity.java // @JsonIgnoreProperties(ignoreUnknown = true) // public class Entity implements FactorioEntity { // // private static int entity_id = 0; // // public int entity_number; // public String name; // public Position position; // public int direction; // public ControlBehavior control_behavior; // public HashMap<String, Connection> connections; // // public Entity(String name) { // this.entity_number = entity_id++; // this.name = name; // } // // // /** // * Connects the entity with the entity associated with the given id. // * @param circuitId if the wire should start at the input or output // * @param color the wire color // * @param entityId the entity to connect to // * @param circuitIdDestination connect to the input or output of the entity // */ // public void addConnection(String circuitId, String color, int entityId, int circuitIdDestination) { // if (connections == null) // connections = new HashMap<>(); // if (!connections.containsKey(circuitId)) // connections.put(circuitId, new Connection()); // if (color.equals("green")) { // if (connections.get(circuitId).green == null) // connections.get(circuitId).green = new ArrayList<>(); // connections.get(circuitId).green.add(new ConnectionDetail(entityId, circuitIdDestination)); // } else if (color.equals("red")) { // if (connections.get(circuitId).red == null) // connections.get(circuitId).red = new ArrayList<>(); // connections.get(circuitId).red.add(new ConnectionDetail(entityId, circuitIdDestination)); // } // } // // } // // Path: src/main/java/entities/blueprint/Position.java // @JsonIgnoreProperties(ignoreUnknown = true) // public class Position { // // public double x; // public double y; // // public Position(double x, double y) { // this.x = x; // this.y = y; // } // } // Path: src/main/java/entities/compiler/EntityGatherer.java import java.util.ArrayList; import entities.blueprint.Entity; import entities.blueprint.Position; package entities.compiler; public class EntityGatherer { public int offsetX; public int offsetY;
public ArrayList<Entity> entities;
un0btanium/FactorioScript
src/main/java/entities/compiler/EntityGatherer.java
// Path: src/main/java/entities/blueprint/Entity.java // @JsonIgnoreProperties(ignoreUnknown = true) // public class Entity implements FactorioEntity { // // private static int entity_id = 0; // // public int entity_number; // public String name; // public Position position; // public int direction; // public ControlBehavior control_behavior; // public HashMap<String, Connection> connections; // // public Entity(String name) { // this.entity_number = entity_id++; // this.name = name; // } // // // /** // * Connects the entity with the entity associated with the given id. // * @param circuitId if the wire should start at the input or output // * @param color the wire color // * @param entityId the entity to connect to // * @param circuitIdDestination connect to the input or output of the entity // */ // public void addConnection(String circuitId, String color, int entityId, int circuitIdDestination) { // if (connections == null) // connections = new HashMap<>(); // if (!connections.containsKey(circuitId)) // connections.put(circuitId, new Connection()); // if (color.equals("green")) { // if (connections.get(circuitId).green == null) // connections.get(circuitId).green = new ArrayList<>(); // connections.get(circuitId).green.add(new ConnectionDetail(entityId, circuitIdDestination)); // } else if (color.equals("red")) { // if (connections.get(circuitId).red == null) // connections.get(circuitId).red = new ArrayList<>(); // connections.get(circuitId).red.add(new ConnectionDetail(entityId, circuitIdDestination)); // } // } // // } // // Path: src/main/java/entities/blueprint/Position.java // @JsonIgnoreProperties(ignoreUnknown = true) // public class Position { // // public double x; // public double y; // // public Position(double x, double y) { // this.x = x; // this.y = y; // } // }
import java.util.ArrayList; import entities.blueprint.Entity; import entities.blueprint.Position;
package entities.compiler; public class EntityGatherer { public int offsetX; public int offsetY; public ArrayList<Entity> entities; public PowerPoleType pole; public Entity lastOutputEntity; public Entity lastInputEntity; private int powerPolesPlaced; private int powerPoleOffset; public EntityGatherer() { this.offsetX = 0; this.offsetY = 0; this.entities = new ArrayList<>(); this.pole = PowerPole.powerPoleTypes.get(PowerPole.powerPole); this.lastOutputEntity = null; this.powerPolesPlaced = 0; this.powerPoleOffset = pole.maxSpace/2 + ((PowerPole.powerPole.equals("medium")) ? 1 : 0); } public void checkForPowerPole() { // TODO improve power pole horizontal placement if (offsetY == powerPoleOffset + powerPolesPlaced * (pole.maxSpace+pole.size)) { offsetY += pole.size; powerPolesPlaced++; } if (offsetY == powerPolesPlaced * (pole.maxSpace+pole.size)) { Entity entity = new Entity(pole.name);
// Path: src/main/java/entities/blueprint/Entity.java // @JsonIgnoreProperties(ignoreUnknown = true) // public class Entity implements FactorioEntity { // // private static int entity_id = 0; // // public int entity_number; // public String name; // public Position position; // public int direction; // public ControlBehavior control_behavior; // public HashMap<String, Connection> connections; // // public Entity(String name) { // this.entity_number = entity_id++; // this.name = name; // } // // // /** // * Connects the entity with the entity associated with the given id. // * @param circuitId if the wire should start at the input or output // * @param color the wire color // * @param entityId the entity to connect to // * @param circuitIdDestination connect to the input or output of the entity // */ // public void addConnection(String circuitId, String color, int entityId, int circuitIdDestination) { // if (connections == null) // connections = new HashMap<>(); // if (!connections.containsKey(circuitId)) // connections.put(circuitId, new Connection()); // if (color.equals("green")) { // if (connections.get(circuitId).green == null) // connections.get(circuitId).green = new ArrayList<>(); // connections.get(circuitId).green.add(new ConnectionDetail(entityId, circuitIdDestination)); // } else if (color.equals("red")) { // if (connections.get(circuitId).red == null) // connections.get(circuitId).red = new ArrayList<>(); // connections.get(circuitId).red.add(new ConnectionDetail(entityId, circuitIdDestination)); // } // } // // } // // Path: src/main/java/entities/blueprint/Position.java // @JsonIgnoreProperties(ignoreUnknown = true) // public class Position { // // public double x; // public double y; // // public Position(double x, double y) { // this.x = x; // this.y = y; // } // } // Path: src/main/java/entities/compiler/EntityGatherer.java import java.util.ArrayList; import entities.blueprint.Entity; import entities.blueprint.Position; package entities.compiler; public class EntityGatherer { public int offsetX; public int offsetY; public ArrayList<Entity> entities; public PowerPoleType pole; public Entity lastOutputEntity; public Entity lastInputEntity; private int powerPolesPlaced; private int powerPoleOffset; public EntityGatherer() { this.offsetX = 0; this.offsetY = 0; this.entities = new ArrayList<>(); this.pole = PowerPole.powerPoleTypes.get(PowerPole.powerPole); this.lastOutputEntity = null; this.powerPolesPlaced = 0; this.powerPoleOffset = pole.maxSpace/2 + ((PowerPole.powerPole.equals("medium")) ? 1 : 0); } public void checkForPowerPole() { // TODO improve power pole horizontal placement if (offsetY == powerPoleOffset + powerPolesPlaced * (pole.maxSpace+pole.size)) { offsetY += pole.size; powerPolesPlaced++; } if (offsetY == powerPolesPlaced * (pole.maxSpace+pole.size)) { Entity entity = new Entity(pole.name);
entity.position = new Position(pole.maxSpace/2, powerPoleOffset + powerPolesPlaced * (pole.maxSpace+pole.size));
un0btanium/FactorioScript
src/main/java/entities/compiler/DeciderCombinator.java
// Path: src/main/java/entities/blueprint/Entity.java // @JsonIgnoreProperties(ignoreUnknown = true) // public class Entity implements FactorioEntity { // // private static int entity_id = 0; // // public int entity_number; // public String name; // public Position position; // public int direction; // public ControlBehavior control_behavior; // public HashMap<String, Connection> connections; // // public Entity(String name) { // this.entity_number = entity_id++; // this.name = name; // } // // // /** // * Connects the entity with the entity associated with the given id. // * @param circuitId if the wire should start at the input or output // * @param color the wire color // * @param entityId the entity to connect to // * @param circuitIdDestination connect to the input or output of the entity // */ // public void addConnection(String circuitId, String color, int entityId, int circuitIdDestination) { // if (connections == null) // connections = new HashMap<>(); // if (!connections.containsKey(circuitId)) // connections.put(circuitId, new Connection()); // if (color.equals("green")) { // if (connections.get(circuitId).green == null) // connections.get(circuitId).green = new ArrayList<>(); // connections.get(circuitId).green.add(new ConnectionDetail(entityId, circuitIdDestination)); // } else if (color.equals("red")) { // if (connections.get(circuitId).red == null) // connections.get(circuitId).red = new ArrayList<>(); // connections.get(circuitId).red.add(new ConnectionDetail(entityId, circuitIdDestination)); // } // } // // } // // Path: src/main/java/entities/blueprint/Position.java // @JsonIgnoreProperties(ignoreUnknown = true) // public class Position { // // public double x; // public double y; // // public Position(double x, double y) { // this.x = x; // this.y = y; // } // }
import entities.blueprint.Entity; import entities.blueprint.Position;
package entities.compiler; public class DeciderCombinator implements Combinator { private Entity entity; /** * * @return returns the unique entity identifier value */ @Override public int getId() { return entity.entity_number; } @Override public Entity getEntity(double x, double y) { // TODO Auto-generated method stub
// Path: src/main/java/entities/blueprint/Entity.java // @JsonIgnoreProperties(ignoreUnknown = true) // public class Entity implements FactorioEntity { // // private static int entity_id = 0; // // public int entity_number; // public String name; // public Position position; // public int direction; // public ControlBehavior control_behavior; // public HashMap<String, Connection> connections; // // public Entity(String name) { // this.entity_number = entity_id++; // this.name = name; // } // // // /** // * Connects the entity with the entity associated with the given id. // * @param circuitId if the wire should start at the input or output // * @param color the wire color // * @param entityId the entity to connect to // * @param circuitIdDestination connect to the input or output of the entity // */ // public void addConnection(String circuitId, String color, int entityId, int circuitIdDestination) { // if (connections == null) // connections = new HashMap<>(); // if (!connections.containsKey(circuitId)) // connections.put(circuitId, new Connection()); // if (color.equals("green")) { // if (connections.get(circuitId).green == null) // connections.get(circuitId).green = new ArrayList<>(); // connections.get(circuitId).green.add(new ConnectionDetail(entityId, circuitIdDestination)); // } else if (color.equals("red")) { // if (connections.get(circuitId).red == null) // connections.get(circuitId).red = new ArrayList<>(); // connections.get(circuitId).red.add(new ConnectionDetail(entityId, circuitIdDestination)); // } // } // // } // // Path: src/main/java/entities/blueprint/Position.java // @JsonIgnoreProperties(ignoreUnknown = true) // public class Position { // // public double x; // public double y; // // public Position(double x, double y) { // this.x = x; // this.y = y; // } // } // Path: src/main/java/entities/compiler/DeciderCombinator.java import entities.blueprint.Entity; import entities.blueprint.Position; package entities.compiler; public class DeciderCombinator implements Combinator { private Entity entity; /** * * @return returns the unique entity identifier value */ @Override public int getId() { return entity.entity_number; } @Override public Entity getEntity(double x, double y) { // TODO Auto-generated method stub
entity.position = new Position(x, y+0.5);
un0btanium/FactorioScript
src/main/java/entities/compiler/StatementOverwrite.java
// Path: src/main/java/entities/blueprint/Entity.java // @JsonIgnoreProperties(ignoreUnknown = true) // public class Entity implements FactorioEntity { // // private static int entity_id = 0; // // public int entity_number; // public String name; // public Position position; // public int direction; // public ControlBehavior control_behavior; // public HashMap<String, Connection> connections; // // public Entity(String name) { // this.entity_number = entity_id++; // this.name = name; // } // // // /** // * Connects the entity with the entity associated with the given id. // * @param circuitId if the wire should start at the input or output // * @param color the wire color // * @param entityId the entity to connect to // * @param circuitIdDestination connect to the input or output of the entity // */ // public void addConnection(String circuitId, String color, int entityId, int circuitIdDestination) { // if (connections == null) // connections = new HashMap<>(); // if (!connections.containsKey(circuitId)) // connections.put(circuitId, new Connection()); // if (color.equals("green")) { // if (connections.get(circuitId).green == null) // connections.get(circuitId).green = new ArrayList<>(); // connections.get(circuitId).green.add(new ConnectionDetail(entityId, circuitIdDestination)); // } else if (color.equals("red")) { // if (connections.get(circuitId).red == null) // connections.get(circuitId).red = new ArrayList<>(); // connections.get(circuitId).red.add(new ConnectionDetail(entityId, circuitIdDestination)); // } // } // // }
import entities.blueprint.Entity;
package entities.compiler; public class StatementOverwrite implements Statement { private Variable variable; private CompilerEntity expression; public StatementOverwrite(Variable variable, CompilerEntity expression) { this.variable = variable; this.expression = expression; } @Override public void getEntities(EntityGatherer eg) { ArithmeticCombinator acEach = new ArithmeticCombinator(); ArithmeticCombinator acNullifier = new ArithmeticCombinator(); acEach.leftEntity = new Variable("signal-each"); acEach.operation = "+"; acEach.rightEntity = new Number(0); acEach.outputSignal = "signal-each"; acNullifier.leftEntity = variable; acNullifier.operation = "*"; acNullifier.rightEntity = new Number(-1); acNullifier.outputSignal = variable.getVariable();
// Path: src/main/java/entities/blueprint/Entity.java // @JsonIgnoreProperties(ignoreUnknown = true) // public class Entity implements FactorioEntity { // // private static int entity_id = 0; // // public int entity_number; // public String name; // public Position position; // public int direction; // public ControlBehavior control_behavior; // public HashMap<String, Connection> connections; // // public Entity(String name) { // this.entity_number = entity_id++; // this.name = name; // } // // // /** // * Connects the entity with the entity associated with the given id. // * @param circuitId if the wire should start at the input or output // * @param color the wire color // * @param entityId the entity to connect to // * @param circuitIdDestination connect to the input or output of the entity // */ // public void addConnection(String circuitId, String color, int entityId, int circuitIdDestination) { // if (connections == null) // connections = new HashMap<>(); // if (!connections.containsKey(circuitId)) // connections.put(circuitId, new Connection()); // if (color.equals("green")) { // if (connections.get(circuitId).green == null) // connections.get(circuitId).green = new ArrayList<>(); // connections.get(circuitId).green.add(new ConnectionDetail(entityId, circuitIdDestination)); // } else if (color.equals("red")) { // if (connections.get(circuitId).red == null) // connections.get(circuitId).red = new ArrayList<>(); // connections.get(circuitId).red.add(new ConnectionDetail(entityId, circuitIdDestination)); // } // } // // } // Path: src/main/java/entities/compiler/StatementOverwrite.java import entities.blueprint.Entity; package entities.compiler; public class StatementOverwrite implements Statement { private Variable variable; private CompilerEntity expression; public StatementOverwrite(Variable variable, CompilerEntity expression) { this.variable = variable; this.expression = expression; } @Override public void getEntities(EntityGatherer eg) { ArithmeticCombinator acEach = new ArithmeticCombinator(); ArithmeticCombinator acNullifier = new ArithmeticCombinator(); acEach.leftEntity = new Variable("signal-each"); acEach.operation = "+"; acEach.rightEntity = new Number(0); acEach.outputSignal = "signal-each"; acNullifier.leftEntity = variable; acNullifier.operation = "*"; acNullifier.rightEntity = new Number(-1); acNullifier.outputSignal = variable.getVariable();
Entity entityAcEach = acEach.getEntity(0, eg.offsetY);
BorjaSanchidrian/DarkOrbitServer
src/com/darkorbit/objects/Portal.java
// Path: src/com/darkorbit/utils/Vector.java // public class Vector { // private double _x; // private double _y; // // public Vector() { // // } // // public double getX() { // return _x; // } // // public double getY() { // return _y; // } // // public void setX(double x) { // this._x = x; // } // // public void setY(double y) { // this._y = y; // } // // // public Vector(double x, double y) { // this._x = x; // this._y = y; // } // // public Vector reset() { // return new Vector(0, 0); // } // // public double distanceTo(Vector Point) { // double dx = this._x - Point._x; // double dy = this._y - Point._y; // return Math.sqrt((dx * dx) + (dy * dy)); // } // // @Override public String toString() { // return this._x + "," + this._y; // } // // @Override public boolean equals(java.lang.Object obj) { // if (obj instanceof Vector) { // Vector v2d = (Vector)obj; // return v2d._x == this._x && v2d._y == this._y; // } // return false; // } // // @Override public int hashCode() { // return (this._x + " " + this._y).hashCode(); // } // // public static Vector plus(Vector One, Vector Two) { // return new Vector(One._x + Two._x, One._y + Two._y); // } // // public static Vector minus (Vector One, Vector Two) { // return new Vector(One._x - Two._x, One._y - Two._y); // } // }
import com.darkorbit.utils.Extra; import com.darkorbit.utils.Vector;
package com.darkorbit.objects; public class Portal { private int portalID, requiredLevel, portalGFX; //Rango => por si se quiere hacer un portal con mas o menos rango.. Por ahora lo dejo constante private int range = 500; private short mapID, toMapID;
// Path: src/com/darkorbit/utils/Vector.java // public class Vector { // private double _x; // private double _y; // // public Vector() { // // } // // public double getX() { // return _x; // } // // public double getY() { // return _y; // } // // public void setX(double x) { // this._x = x; // } // // public void setY(double y) { // this._y = y; // } // // // public Vector(double x, double y) { // this._x = x; // this._y = y; // } // // public Vector reset() { // return new Vector(0, 0); // } // // public double distanceTo(Vector Point) { // double dx = this._x - Point._x; // double dy = this._y - Point._y; // return Math.sqrt((dx * dx) + (dy * dy)); // } // // @Override public String toString() { // return this._x + "," + this._y; // } // // @Override public boolean equals(java.lang.Object obj) { // if (obj instanceof Vector) { // Vector v2d = (Vector)obj; // return v2d._x == this._x && v2d._y == this._y; // } // return false; // } // // @Override public int hashCode() { // return (this._x + " " + this._y).hashCode(); // } // // public static Vector plus(Vector One, Vector Two) { // return new Vector(One._x + Two._x, One._y + Two._y); // } // // public static Vector minus (Vector One, Vector Two) { // return new Vector(One._x - Two._x, One._y - Two._y); // } // } // Path: src/com/darkorbit/objects/Portal.java import com.darkorbit.utils.Extra; import com.darkorbit.utils.Vector; package com.darkorbit.objects; public class Portal { private int portalID, requiredLevel, portalGFX; //Rango => por si se quiere hacer un portal con mas o menos rango.. Por ahora lo dejo constante private int range = 500; private short mapID, toMapID;
private Vector position, destination;
cilogi/gaeshiro
src/main/java/com/cilogi/shiro/oauth/OAuthAuthenticationToken.java
// Path: src/main/java/com/cilogi/shiro/gae/UserAuthType.java // public enum UserAuthType { // CILOGI, GOOGLE, FACEBOOK; // }
import com.cilogi.shiro.gae.UserAuthType; import com.google.common.base.Preconditions; import org.apache.shiro.authc.HostAuthenticationToken; import org.apache.shiro.authc.RememberMeAuthenticationToken; import java.util.logging.Logger;
// Copyright (c) 2012 Tim Niblett. All Rights Reserved. // // File: OAuthAuthenticationToken.java (07-Oct-2012) // Author: tim // // Copyright in the whole and every part of this source file belongs to // Tim Niblett (the Author) and may not be used, sold, licenced, // transferred, copied or reproduced in whole or in part in // any manner or form or in or on any media to any person other than // in accordance with the terms of The Author's agreement // or otherwise without the prior written consent of The Author. All // information contained in this source file is confidential information // belonging to The Author and as such may not be disclosed other // than in accordance with the terms of The Author's agreement, or // otherwise, without the prior written consent of The Author. As // confidential information this source file must be kept fully and // effectively secure at all times. // package com.cilogi.shiro.oauth; public class OAuthAuthenticationToken implements HostAuthenticationToken, RememberMeAuthenticationToken { static final Logger LOG = Logger.getLogger(OAuthAuthenticationToken.class.getName()); private final String token;
// Path: src/main/java/com/cilogi/shiro/gae/UserAuthType.java // public enum UserAuthType { // CILOGI, GOOGLE, FACEBOOK; // } // Path: src/main/java/com/cilogi/shiro/oauth/OAuthAuthenticationToken.java import com.cilogi.shiro.gae.UserAuthType; import com.google.common.base.Preconditions; import org.apache.shiro.authc.HostAuthenticationToken; import org.apache.shiro.authc.RememberMeAuthenticationToken; import java.util.logging.Logger; // Copyright (c) 2012 Tim Niblett. All Rights Reserved. // // File: OAuthAuthenticationToken.java (07-Oct-2012) // Author: tim // // Copyright in the whole and every part of this source file belongs to // Tim Niblett (the Author) and may not be used, sold, licenced, // transferred, copied or reproduced in whole or in part in // any manner or form or in or on any media to any person other than // in accordance with the terms of The Author's agreement // or otherwise without the prior written consent of The Author. All // information contained in this source file is confidential information // belonging to The Author and as such may not be disclosed other // than in accordance with the terms of The Author's agreement, or // otherwise, without the prior written consent of The Author. As // confidential information this source file must be kept fully and // effectively secure at all times. // package com.cilogi.shiro.oauth; public class OAuthAuthenticationToken implements HostAuthenticationToken, RememberMeAuthenticationToken { static final Logger LOG = Logger.getLogger(OAuthAuthenticationToken.class.getName()); private final String token;
private final UserAuthType authType;
cilogi/gaeshiro
src/main/java/com/cilogi/shiro/oauth/OAuthRealm.java
// Path: src/main/java/com/cilogi/shiro/gae/MemcacheManager.java // public class MemcacheManager implements CacheManager { // public <K, V> Cache<K, V> getCache(String name) throws CacheException { // return new Memcache<K, V>(name); // } // }
import com.cilogi.shiro.gae.MemcacheManager; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationToken; import org.apache.shiro.realm.AuthenticatingRealm; import java.util.logging.Logger;
// Copyright (c) 2012 Tim Niblett. All Rights Reserved. // // File: OAuthRealm.java (07-Oct-2012) // Author: tim // // Copyright in the whole and every part of this source file belongs to // Tim Niblett (the Author) and may not be used, sold, licenced, // transferred, copied or reproduced in whole or in part in // any manner or form or in or on any media to any person other than // in accordance with the terms of The Author's agreement // or otherwise without the prior written consent of The Author. All // information contained in this source file is confidential information // belonging to The Author and as such may not be disclosed other // than in accordance with the terms of The Author's agreement, or // otherwise, without the prior written consent of The Author. As // confidential information this source file must be kept fully and // effectively secure at all times. // package com.cilogi.shiro.oauth; public class OAuthRealm extends AuthenticatingRealm { static final Logger LOG = Logger.getLogger(OAuthRealm.class.getName()); public OAuthRealm() {
// Path: src/main/java/com/cilogi/shiro/gae/MemcacheManager.java // public class MemcacheManager implements CacheManager { // public <K, V> Cache<K, V> getCache(String name) throws CacheException { // return new Memcache<K, V>(name); // } // } // Path: src/main/java/com/cilogi/shiro/oauth/OAuthRealm.java import com.cilogi.shiro.gae.MemcacheManager; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationToken; import org.apache.shiro.realm.AuthenticatingRealm; import java.util.logging.Logger; // Copyright (c) 2012 Tim Niblett. All Rights Reserved. // // File: OAuthRealm.java (07-Oct-2012) // Author: tim // // Copyright in the whole and every part of this source file belongs to // Tim Niblett (the Author) and may not be used, sold, licenced, // transferred, copied or reproduced in whole or in part in // any manner or form or in or on any media to any person other than // in accordance with the terms of The Author's agreement // or otherwise without the prior written consent of The Author. All // information contained in this source file is confidential information // belonging to The Author and as such may not be disclosed other // than in accordance with the terms of The Author's agreement, or // otherwise, without the prior written consent of The Author. As // confidential information this source file must be kept fully and // effectively secure at all times. // package com.cilogi.shiro.oauth; public class OAuthRealm extends AuthenticatingRealm { static final Logger LOG = Logger.getLogger(OAuthRealm.class.getName()); public OAuthRealm() {
super(new MemcacheManager(), new OAuthCredentialsMatcher());
cilogi/gaeshiro
src/main/java/com/cilogi/shiro/oauth/provider/GoogleAuth.java
// Path: src/main/java/com/cilogi/shiro/gae/UserAuthType.java // public enum UserAuthType { // CILOGI, GOOGLE, FACEBOOK; // } // // Path: src/main/java/com/cilogi/shiro/oauth/OAuthInfo.java // public class OAuthInfo { // static final Logger LOG = Logger.getLogger(OAuthInfo.class.getName()); // // private final String token; // private final String email; // private final String errorString; // private final UserAuthType userAuthType; // // private OAuthInfo(String token, String email, String errorString, UserAuthType userAuthType) { // this.token = token; // this.email = email; // this.errorString = errorString; // this.userAuthType = userAuthType; // } // // public boolean isError() { // return errorString != null; // } // // public UserAuthType getUserAuthType() { // return userAuthType; // } // // public String getToken() { // return token; // } // // public String getEmail() { // return email; // } // // public String getErrorString() { // return errorString; // } // // public static class Builder { // private String token; // private String email; // private String errorString; // private UserAuthType authType; // // public Builder(UserAuthType authType) { // this.authType = authType; // } // public Builder token(String token) { this.token = token; return this; } // public Builder email(String email) { this.email = email; return this; } // public Builder errorString(String errorString) { this.errorString = errorString; return this; } // // public OAuthInfo build() { // if (errorString == null) { // Preconditions.checkNotNull(token, "You cannot have an empty token when there are no errors"); // Preconditions.checkNotNull(email, "You cannot have an empty email address when there are no errors"); // Preconditions.checkNotNull(authType, "You cannot have a null auth type"); // } // return new OAuthInfo(token, email, errorString, authType); // } // } // }
import javax.inject.Inject; import javax.inject.Named; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.net.URL; import java.util.Properties; import java.util.logging.Logger; import com.cilogi.shiro.gae.UserAuthType; import com.cilogi.shiro.oauth.OAuthInfo; import com.google.appengine.api.urlfetch.*; import com.google.common.base.Charsets; import org.apache.shiro.web.util.WebUtils; import org.json.JSONException; import org.json.JSONObject; import org.scribe.builder.ServiceBuilder; import org.scribe.model.*; import org.scribe.oauth.OAuthService;
// Copyright (c) 2012 Tim Niblett. All Rights Reserved. // // File: GoogleAuth.java (06-Oct-2012) // Author: tim // // Copyright in the whole and every part of this source file belongs to // Tim Niblett (the Author) and may not be used, sold, licenced, // transferred, copied or reproduced in whole or in part in // any manner or form or in or on any media to any person other than // in accordance with the terms of The Author's agreement // or otherwise without the prior written consent of The Author. All // information contained in this source file is confidential information // belonging to The Author and as such may not be disclosed other // than in accordance with the terms of The Author's agreement, or // otherwise, without the prior written consent of The Author. As // confidential information this source file must be kept fully and // effectively secure at all times. // package com.cilogi.shiro.oauth.provider; public class GoogleAuth extends AuthBase implements IOAuthProviderInfo { static final Logger LOG = Logger.getLogger(GoogleAuth.class.getName()); private static final String PROTECTED_RESOURCE_URL = "https://www.googleapis.com/userinfo/email?alt=json"; private static final String SCOPE = "https://www.googleapis.com/auth/userinfo.email"; private static final Token EMPTY_TOKEN = null; private final String apiKey; private final String apiSecret; private final String host; @Inject public GoogleAuth(@Named("social.site") String site) { LOG.info("site is " + site); String prefix = "gg." + site; Properties props = new Properties(); loadProperties(props, "/social.properties"); apiKey = props.getProperty(prefix + ".apiKey"); apiSecret = props.getProperty(prefix + ".apiSecret"); host = props.getProperty(prefix + ".host"); } @Override
// Path: src/main/java/com/cilogi/shiro/gae/UserAuthType.java // public enum UserAuthType { // CILOGI, GOOGLE, FACEBOOK; // } // // Path: src/main/java/com/cilogi/shiro/oauth/OAuthInfo.java // public class OAuthInfo { // static final Logger LOG = Logger.getLogger(OAuthInfo.class.getName()); // // private final String token; // private final String email; // private final String errorString; // private final UserAuthType userAuthType; // // private OAuthInfo(String token, String email, String errorString, UserAuthType userAuthType) { // this.token = token; // this.email = email; // this.errorString = errorString; // this.userAuthType = userAuthType; // } // // public boolean isError() { // return errorString != null; // } // // public UserAuthType getUserAuthType() { // return userAuthType; // } // // public String getToken() { // return token; // } // // public String getEmail() { // return email; // } // // public String getErrorString() { // return errorString; // } // // public static class Builder { // private String token; // private String email; // private String errorString; // private UserAuthType authType; // // public Builder(UserAuthType authType) { // this.authType = authType; // } // public Builder token(String token) { this.token = token; return this; } // public Builder email(String email) { this.email = email; return this; } // public Builder errorString(String errorString) { this.errorString = errorString; return this; } // // public OAuthInfo build() { // if (errorString == null) { // Preconditions.checkNotNull(token, "You cannot have an empty token when there are no errors"); // Preconditions.checkNotNull(email, "You cannot have an empty email address when there are no errors"); // Preconditions.checkNotNull(authType, "You cannot have a null auth type"); // } // return new OAuthInfo(token, email, errorString, authType); // } // } // } // Path: src/main/java/com/cilogi/shiro/oauth/provider/GoogleAuth.java import javax.inject.Inject; import javax.inject.Named; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.net.URL; import java.util.Properties; import java.util.logging.Logger; import com.cilogi.shiro.gae.UserAuthType; import com.cilogi.shiro.oauth.OAuthInfo; import com.google.appengine.api.urlfetch.*; import com.google.common.base.Charsets; import org.apache.shiro.web.util.WebUtils; import org.json.JSONException; import org.json.JSONObject; import org.scribe.builder.ServiceBuilder; import org.scribe.model.*; import org.scribe.oauth.OAuthService; // Copyright (c) 2012 Tim Niblett. All Rights Reserved. // // File: GoogleAuth.java (06-Oct-2012) // Author: tim // // Copyright in the whole and every part of this source file belongs to // Tim Niblett (the Author) and may not be used, sold, licenced, // transferred, copied or reproduced in whole or in part in // any manner or form or in or on any media to any person other than // in accordance with the terms of The Author's agreement // or otherwise without the prior written consent of The Author. All // information contained in this source file is confidential information // belonging to The Author and as such may not be disclosed other // than in accordance with the terms of The Author's agreement, or // otherwise, without the prior written consent of The Author. As // confidential information this source file must be kept fully and // effectively secure at all times. // package com.cilogi.shiro.oauth.provider; public class GoogleAuth extends AuthBase implements IOAuthProviderInfo { static final Logger LOG = Logger.getLogger(GoogleAuth.class.getName()); private static final String PROTECTED_RESOURCE_URL = "https://www.googleapis.com/userinfo/email?alt=json"; private static final String SCOPE = "https://www.googleapis.com/auth/userinfo.email"; private static final Token EMPTY_TOKEN = null; private final String apiKey; private final String apiSecret; private final String host; @Inject public GoogleAuth(@Named("social.site") String site) { LOG.info("site is " + site); String prefix = "gg." + site; Properties props = new Properties(); loadProperties(props, "/social.properties"); apiKey = props.getProperty(prefix + ".apiKey"); apiSecret = props.getProperty(prefix + ".apiSecret"); host = props.getProperty(prefix + ".host"); } @Override
public UserAuthType getUserAuthType() {
cilogi/gaeshiro
src/main/java/com/cilogi/shiro/oauth/provider/GoogleAuth.java
// Path: src/main/java/com/cilogi/shiro/gae/UserAuthType.java // public enum UserAuthType { // CILOGI, GOOGLE, FACEBOOK; // } // // Path: src/main/java/com/cilogi/shiro/oauth/OAuthInfo.java // public class OAuthInfo { // static final Logger LOG = Logger.getLogger(OAuthInfo.class.getName()); // // private final String token; // private final String email; // private final String errorString; // private final UserAuthType userAuthType; // // private OAuthInfo(String token, String email, String errorString, UserAuthType userAuthType) { // this.token = token; // this.email = email; // this.errorString = errorString; // this.userAuthType = userAuthType; // } // // public boolean isError() { // return errorString != null; // } // // public UserAuthType getUserAuthType() { // return userAuthType; // } // // public String getToken() { // return token; // } // // public String getEmail() { // return email; // } // // public String getErrorString() { // return errorString; // } // // public static class Builder { // private String token; // private String email; // private String errorString; // private UserAuthType authType; // // public Builder(UserAuthType authType) { // this.authType = authType; // } // public Builder token(String token) { this.token = token; return this; } // public Builder email(String email) { this.email = email; return this; } // public Builder errorString(String errorString) { this.errorString = errorString; return this; } // // public OAuthInfo build() { // if (errorString == null) { // Preconditions.checkNotNull(token, "You cannot have an empty token when there are no errors"); // Preconditions.checkNotNull(email, "You cannot have an empty email address when there are no errors"); // Preconditions.checkNotNull(authType, "You cannot have a null auth type"); // } // return new OAuthInfo(token, email, errorString, authType); // } // } // }
import javax.inject.Inject; import javax.inject.Named; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.net.URL; import java.util.Properties; import java.util.logging.Logger; import com.cilogi.shiro.gae.UserAuthType; import com.cilogi.shiro.oauth.OAuthInfo; import com.google.appengine.api.urlfetch.*; import com.google.common.base.Charsets; import org.apache.shiro.web.util.WebUtils; import org.json.JSONException; import org.json.JSONObject; import org.scribe.builder.ServiceBuilder; import org.scribe.model.*; import org.scribe.oauth.OAuthService;
Properties props = new Properties(); loadProperties(props, "/social.properties"); apiKey = props.getProperty(prefix + ".apiKey"); apiSecret = props.getProperty(prefix + ".apiSecret"); host = props.getProperty(prefix + ".host"); } @Override public UserAuthType getUserAuthType() { return UserAuthType.GOOGLE; } @Override public String loginURL(String callbackUri) { OAuthService service = new ServiceBuilder() .provider(GoogleApi20.class) .apiKey(apiKey) .apiSecret(apiSecret) .callback(makeAbsolute(callbackUri)) .scope("https://www.googleapis.com/auth/userinfo.email") .build(); return service.getAuthorizationUrl(EMPTY_TOKEN); } @Override public String reAuthenticateURL(String callbackUri) { return loginURL(callbackUri)+"&approval_prompt=force"; } @Override
// Path: src/main/java/com/cilogi/shiro/gae/UserAuthType.java // public enum UserAuthType { // CILOGI, GOOGLE, FACEBOOK; // } // // Path: src/main/java/com/cilogi/shiro/oauth/OAuthInfo.java // public class OAuthInfo { // static final Logger LOG = Logger.getLogger(OAuthInfo.class.getName()); // // private final String token; // private final String email; // private final String errorString; // private final UserAuthType userAuthType; // // private OAuthInfo(String token, String email, String errorString, UserAuthType userAuthType) { // this.token = token; // this.email = email; // this.errorString = errorString; // this.userAuthType = userAuthType; // } // // public boolean isError() { // return errorString != null; // } // // public UserAuthType getUserAuthType() { // return userAuthType; // } // // public String getToken() { // return token; // } // // public String getEmail() { // return email; // } // // public String getErrorString() { // return errorString; // } // // public static class Builder { // private String token; // private String email; // private String errorString; // private UserAuthType authType; // // public Builder(UserAuthType authType) { // this.authType = authType; // } // public Builder token(String token) { this.token = token; return this; } // public Builder email(String email) { this.email = email; return this; } // public Builder errorString(String errorString) { this.errorString = errorString; return this; } // // public OAuthInfo build() { // if (errorString == null) { // Preconditions.checkNotNull(token, "You cannot have an empty token when there are no errors"); // Preconditions.checkNotNull(email, "You cannot have an empty email address when there are no errors"); // Preconditions.checkNotNull(authType, "You cannot have a null auth type"); // } // return new OAuthInfo(token, email, errorString, authType); // } // } // } // Path: src/main/java/com/cilogi/shiro/oauth/provider/GoogleAuth.java import javax.inject.Inject; import javax.inject.Named; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.net.URL; import java.util.Properties; import java.util.logging.Logger; import com.cilogi.shiro.gae.UserAuthType; import com.cilogi.shiro.oauth.OAuthInfo; import com.google.appengine.api.urlfetch.*; import com.google.common.base.Charsets; import org.apache.shiro.web.util.WebUtils; import org.json.JSONException; import org.json.JSONObject; import org.scribe.builder.ServiceBuilder; import org.scribe.model.*; import org.scribe.oauth.OAuthService; Properties props = new Properties(); loadProperties(props, "/social.properties"); apiKey = props.getProperty(prefix + ".apiKey"); apiSecret = props.getProperty(prefix + ".apiSecret"); host = props.getProperty(prefix + ".host"); } @Override public UserAuthType getUserAuthType() { return UserAuthType.GOOGLE; } @Override public String loginURL(String callbackUri) { OAuthService service = new ServiceBuilder() .provider(GoogleApi20.class) .apiKey(apiKey) .apiSecret(apiSecret) .callback(makeAbsolute(callbackUri)) .scope("https://www.googleapis.com/auth/userinfo.email") .build(); return service.getAuthorizationUrl(EMPTY_TOKEN); } @Override public String reAuthenticateURL(String callbackUri) { return loginURL(callbackUri)+"&approval_prompt=force"; } @Override
public OAuthInfo getUserInfo(String code, String callBackUrl) {
cilogi/gaeshiro
src/main/java/com/cilogi/shiro/oauth/OAuthInfo.java
// Path: src/main/java/com/cilogi/shiro/gae/UserAuthType.java // public enum UserAuthType { // CILOGI, GOOGLE, FACEBOOK; // }
import java.util.logging.Logger; import com.cilogi.shiro.gae.UserAuthType; import com.google.common.base.Preconditions;
// Copyright (c) 2012 Tim Niblett. All Rights Reserved. // // File: OAuthInfo.java (08-Oct-2012) // Author: tim // // Copyright in the whole and every part of this source file belongs to // Tim Niblett (the Author) and may not be used, sold, licenced, // transferred, copied or reproduced in whole or in part in // any manner or form or in or on any media to any person other than // in accordance with the terms of The Author's agreement // or otherwise without the prior written consent of The Author. All // information contained in this source file is confidential information // belonging to The Author and as such may not be disclosed other // than in accordance with the terms of The Author's agreement, or // otherwise, without the prior written consent of The Author. As // confidential information this source file must be kept fully and // effectively secure at all times. // package com.cilogi.shiro.oauth; // The info we store when we perform a successful OAuth request with a token. public class OAuthInfo { static final Logger LOG = Logger.getLogger(OAuthInfo.class.getName()); private final String token; private final String email; private final String errorString;
// Path: src/main/java/com/cilogi/shiro/gae/UserAuthType.java // public enum UserAuthType { // CILOGI, GOOGLE, FACEBOOK; // } // Path: src/main/java/com/cilogi/shiro/oauth/OAuthInfo.java import java.util.logging.Logger; import com.cilogi.shiro.gae.UserAuthType; import com.google.common.base.Preconditions; // Copyright (c) 2012 Tim Niblett. All Rights Reserved. // // File: OAuthInfo.java (08-Oct-2012) // Author: tim // // Copyright in the whole and every part of this source file belongs to // Tim Niblett (the Author) and may not be used, sold, licenced, // transferred, copied or reproduced in whole or in part in // any manner or form or in or on any media to any person other than // in accordance with the terms of The Author's agreement // or otherwise without the prior written consent of The Author. All // information contained in this source file is confidential information // belonging to The Author and as such may not be disclosed other // than in accordance with the terms of The Author's agreement, or // otherwise, without the prior written consent of The Author. As // confidential information this source file must be kept fully and // effectively secure at all times. // package com.cilogi.shiro.oauth; // The info we store when we perform a successful OAuth request with a token. public class OAuthInfo { static final Logger LOG = Logger.getLogger(OAuthInfo.class.getName()); private final String token; private final String email; private final String errorString;
private final UserAuthType userAuthType;
cilogi/gaeshiro
src/main/java/com/cilogi/shiro/googlegae/GoogleGAERealm.java
// Path: src/main/java/com/cilogi/shiro/gae/MemcacheManager.java // public class MemcacheManager implements CacheManager { // public <K, V> Cache<K, V> getCache(String name) throws CacheException { // return new Memcache<K, V>(name); // } // }
import com.cilogi.shiro.gae.MemcacheManager; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationToken; import org.apache.shiro.realm.AuthenticatingRealm; import java.util.logging.Logger;
// Copyright (c) 2012 Tim Niblett. All Rights Reserved. // // File: GoogleGAERealm.java (16-Oct-2012) // Author: tim // // Copyright in the whole and every part of this source file belongs to // Tim Niblett (the Author) and may not be used, sold, licenced, // transferred, copied or reproduced in whole or in part in // any manner or form or in or on any media to any person other than // in accordance with the terms of The Author's agreement // or otherwise without the prior written consent of The Author. All // information contained in this source file is confidential information // belonging to The Author and as such may not be disclosed other // than in accordance with the terms of The Author's agreement, or // otherwise, without the prior written consent of The Author. As // confidential information this source file must be kept fully and // effectively secure at all times. // package com.cilogi.shiro.googlegae; public class GoogleGAERealm extends AuthenticatingRealm { static final Logger LOG = Logger.getLogger(GoogleGAERealm.class.getName()); public GoogleGAERealm() {
// Path: src/main/java/com/cilogi/shiro/gae/MemcacheManager.java // public class MemcacheManager implements CacheManager { // public <K, V> Cache<K, V> getCache(String name) throws CacheException { // return new Memcache<K, V>(name); // } // } // Path: src/main/java/com/cilogi/shiro/googlegae/GoogleGAERealm.java import com.cilogi.shiro.gae.MemcacheManager; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationToken; import org.apache.shiro.realm.AuthenticatingRealm; import java.util.logging.Logger; // Copyright (c) 2012 Tim Niblett. All Rights Reserved. // // File: GoogleGAERealm.java (16-Oct-2012) // Author: tim // // Copyright in the whole and every part of this source file belongs to // Tim Niblett (the Author) and may not be used, sold, licenced, // transferred, copied or reproduced in whole or in part in // any manner or form or in or on any media to any person other than // in accordance with the terms of The Author's agreement // or otherwise without the prior written consent of The Author. All // information contained in this source file is confidential information // belonging to The Author and as such may not be disclosed other // than in accordance with the terms of The Author's agreement, or // otherwise, without the prior written consent of The Author. As // confidential information this source file must be kept fully and // effectively secure at all times. // package com.cilogi.shiro.googlegae; public class GoogleGAERealm extends AuthenticatingRealm { static final Logger LOG = Logger.getLogger(GoogleGAERealm.class.getName()); public GoogleGAERealm() {
super(new MemcacheManager(), new GoogleGAECredentialsMatcher());
cilogi/gaeshiro
src/main/java/com/cilogi/shiro/oauth/provider/IOAuthProviderInfo.java
// Path: src/main/java/com/cilogi/shiro/gae/UserAuthType.java // public enum UserAuthType { // CILOGI, GOOGLE, FACEBOOK; // } // // Path: src/main/java/com/cilogi/shiro/oauth/OAuthInfo.java // public class OAuthInfo { // static final Logger LOG = Logger.getLogger(OAuthInfo.class.getName()); // // private final String token; // private final String email; // private final String errorString; // private final UserAuthType userAuthType; // // private OAuthInfo(String token, String email, String errorString, UserAuthType userAuthType) { // this.token = token; // this.email = email; // this.errorString = errorString; // this.userAuthType = userAuthType; // } // // public boolean isError() { // return errorString != null; // } // // public UserAuthType getUserAuthType() { // return userAuthType; // } // // public String getToken() { // return token; // } // // public String getEmail() { // return email; // } // // public String getErrorString() { // return errorString; // } // // public static class Builder { // private String token; // private String email; // private String errorString; // private UserAuthType authType; // // public Builder(UserAuthType authType) { // this.authType = authType; // } // public Builder token(String token) { this.token = token; return this; } // public Builder email(String email) { this.email = email; return this; } // public Builder errorString(String errorString) { this.errorString = errorString; return this; } // // public OAuthInfo build() { // if (errorString == null) { // Preconditions.checkNotNull(token, "You cannot have an empty token when there are no errors"); // Preconditions.checkNotNull(email, "You cannot have an empty email address when there are no errors"); // Preconditions.checkNotNull(authType, "You cannot have a null auth type"); // } // return new OAuthInfo(token, email, errorString, authType); // } // } // }
import com.cilogi.shiro.gae.UserAuthType; import com.cilogi.shiro.oauth.OAuthInfo; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException;
// Copyright (c) 2012 Tim Niblett. All Rights Reserved. // // File: IOAuthProviderInfo.java (08-Oct-2012) // Author: tim // // Copyright in the whole and every part of this source file belongs to // Tim Niblett (the Author) and may not be used, sold, licenced, // transferred, copied or reproduced in whole or in part in // any manner or form or in or on any media to any person other than // in accordance with the terms of The Author's agreement // or otherwise without the prior written consent of The Author. All // information contained in this source file is confidential information // belonging to The Author and as such may not be disclosed other // than in accordance with the terms of The Author's agreement, or // otherwise, without the prior written consent of The Author. As // confidential information this source file must be kept fully and // effectively secure at all times. // package com.cilogi.shiro.oauth.provider; public interface IOAuthProviderInfo { /** * Which type of authorization is being used? Each one is handled somewhat differently. * @return The enum type */ public UserAuthType getUserAuthType(); /** * The URL to call on login, to get a code. * @param callbackUri Where to go afterwards. * @return */ public String loginURL(String callbackUri); /** * The URL to call on re-authentication, to get a code. * @param callbackUri Where to go afterwards. * @return */ public String reAuthenticateURL(String callbackUri); /** * Information about the user. At the moment its pretty-much just the * email address. * @param code The auth token * @param callBackUrl Where to go afterwards * @return The info. */
// Path: src/main/java/com/cilogi/shiro/gae/UserAuthType.java // public enum UserAuthType { // CILOGI, GOOGLE, FACEBOOK; // } // // Path: src/main/java/com/cilogi/shiro/oauth/OAuthInfo.java // public class OAuthInfo { // static final Logger LOG = Logger.getLogger(OAuthInfo.class.getName()); // // private final String token; // private final String email; // private final String errorString; // private final UserAuthType userAuthType; // // private OAuthInfo(String token, String email, String errorString, UserAuthType userAuthType) { // this.token = token; // this.email = email; // this.errorString = errorString; // this.userAuthType = userAuthType; // } // // public boolean isError() { // return errorString != null; // } // // public UserAuthType getUserAuthType() { // return userAuthType; // } // // public String getToken() { // return token; // } // // public String getEmail() { // return email; // } // // public String getErrorString() { // return errorString; // } // // public static class Builder { // private String token; // private String email; // private String errorString; // private UserAuthType authType; // // public Builder(UserAuthType authType) { // this.authType = authType; // } // public Builder token(String token) { this.token = token; return this; } // public Builder email(String email) { this.email = email; return this; } // public Builder errorString(String errorString) { this.errorString = errorString; return this; } // // public OAuthInfo build() { // if (errorString == null) { // Preconditions.checkNotNull(token, "You cannot have an empty token when there are no errors"); // Preconditions.checkNotNull(email, "You cannot have an empty email address when there are no errors"); // Preconditions.checkNotNull(authType, "You cannot have a null auth type"); // } // return new OAuthInfo(token, email, errorString, authType); // } // } // } // Path: src/main/java/com/cilogi/shiro/oauth/provider/IOAuthProviderInfo.java import com.cilogi.shiro.gae.UserAuthType; import com.cilogi.shiro.oauth.OAuthInfo; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; // Copyright (c) 2012 Tim Niblett. All Rights Reserved. // // File: IOAuthProviderInfo.java (08-Oct-2012) // Author: tim // // Copyright in the whole and every part of this source file belongs to // Tim Niblett (the Author) and may not be used, sold, licenced, // transferred, copied or reproduced in whole or in part in // any manner or form or in or on any media to any person other than // in accordance with the terms of The Author's agreement // or otherwise without the prior written consent of The Author. All // information contained in this source file is confidential information // belonging to The Author and as such may not be disclosed other // than in accordance with the terms of The Author's agreement, or // otherwise, without the prior written consent of The Author. As // confidential information this source file must be kept fully and // effectively secure at all times. // package com.cilogi.shiro.oauth.provider; public interface IOAuthProviderInfo { /** * Which type of authorization is being used? Each one is handled somewhat differently. * @return The enum type */ public UserAuthType getUserAuthType(); /** * The URL to call on login, to get a code. * @param callbackUri Where to go afterwards. * @return */ public String loginURL(String callbackUri); /** * The URL to call on re-authentication, to get a code. * @param callbackUri Where to go afterwards. * @return */ public String reAuthenticateURL(String callbackUri); /** * Information about the user. At the moment its pretty-much just the * email address. * @param code The auth token * @param callBackUrl Where to go afterwards * @return The info. */
public OAuthInfo getUserInfo(String code, String callBackUrl);
cilogi/gaeshiro
src/main/java/com/cilogi/shiro/oauth/provider/FacebookAuth.java
// Path: src/main/java/com/cilogi/shiro/gae/UserAuthType.java // public enum UserAuthType { // CILOGI, GOOGLE, FACEBOOK; // } // // Path: src/main/java/com/cilogi/shiro/oauth/OAuthInfo.java // public class OAuthInfo { // static final Logger LOG = Logger.getLogger(OAuthInfo.class.getName()); // // private final String token; // private final String email; // private final String errorString; // private final UserAuthType userAuthType; // // private OAuthInfo(String token, String email, String errorString, UserAuthType userAuthType) { // this.token = token; // this.email = email; // this.errorString = errorString; // this.userAuthType = userAuthType; // } // // public boolean isError() { // return errorString != null; // } // // public UserAuthType getUserAuthType() { // return userAuthType; // } // // public String getToken() { // return token; // } // // public String getEmail() { // return email; // } // // public String getErrorString() { // return errorString; // } // // public static class Builder { // private String token; // private String email; // private String errorString; // private UserAuthType authType; // // public Builder(UserAuthType authType) { // this.authType = authType; // } // public Builder token(String token) { this.token = token; return this; } // public Builder email(String email) { this.email = email; return this; } // public Builder errorString(String errorString) { this.errorString = errorString; return this; } // // public OAuthInfo build() { // if (errorString == null) { // Preconditions.checkNotNull(token, "You cannot have an empty token when there are no errors"); // Preconditions.checkNotNull(email, "You cannot have an empty email address when there are no errors"); // Preconditions.checkNotNull(authType, "You cannot have a null auth type"); // } // return new OAuthInfo(token, email, errorString, authType); // } // } // }
import javax.inject.Inject; import javax.inject.Named; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Properties; import java.util.logging.Logger; import com.cilogi.shiro.gae.UserAuthType; import com.cilogi.shiro.oauth.OAuthInfo; import org.json.JSONException; import org.json.JSONObject; import org.scribe.builder.ServiceBuilder; import org.scribe.builder.api.FacebookApi; import org.scribe.model.*; import org.scribe.oauth.OAuthService; import org.scribe.utils.OAuthEncoder;
// Copyright (c) 2012 Tim Niblett. All Rights Reserved. // // File: FacebookAuth.java (05-Oct-2012) // Author: tim // // Copyright in the whole and every part of this source file belongs to // Tim Niblett (the Author) and may not be used, sold, licenced, // transferred, copied or reproduced in whole or in part in // any manner or form or in or on any media to any person other than // in accordance with the terms of The Author's agreement // or otherwise without the prior written consent of The Author. All // information contained in this source file is confidential information // belonging to The Author and as such may not be disclosed other // than in accordance with the terms of The Author's agreement, or // otherwise, without the prior written consent of The Author. As // confidential information this source file must be kept fully and // effectively secure at all times. // package com.cilogi.shiro.oauth.provider; public class FacebookAuth extends AuthBase implements IOAuthProviderInfo { static final Logger LOG = Logger.getLogger(FacebookAuth.class.getName()); private static final String PROTECTED_RESOURCE_URL = "https://graph.facebook.com/me"; private static final Token EMPTY_TOKEN = null; private final String apiKey; private final String apiSecret; private final String host; @Inject public FacebookAuth(@Named("social.site") String site) { LOG.info("prefix is " + site); String prefix = "fb." + site; Properties props = new Properties(); loadProperties(props, "/social.properties"); apiKey = props.getProperty(prefix + ".apiKey"); apiSecret = props.getProperty(prefix + ".apiSecret"); host = props.getProperty(prefix + ".host"); } @Override
// Path: src/main/java/com/cilogi/shiro/gae/UserAuthType.java // public enum UserAuthType { // CILOGI, GOOGLE, FACEBOOK; // } // // Path: src/main/java/com/cilogi/shiro/oauth/OAuthInfo.java // public class OAuthInfo { // static final Logger LOG = Logger.getLogger(OAuthInfo.class.getName()); // // private final String token; // private final String email; // private final String errorString; // private final UserAuthType userAuthType; // // private OAuthInfo(String token, String email, String errorString, UserAuthType userAuthType) { // this.token = token; // this.email = email; // this.errorString = errorString; // this.userAuthType = userAuthType; // } // // public boolean isError() { // return errorString != null; // } // // public UserAuthType getUserAuthType() { // return userAuthType; // } // // public String getToken() { // return token; // } // // public String getEmail() { // return email; // } // // public String getErrorString() { // return errorString; // } // // public static class Builder { // private String token; // private String email; // private String errorString; // private UserAuthType authType; // // public Builder(UserAuthType authType) { // this.authType = authType; // } // public Builder token(String token) { this.token = token; return this; } // public Builder email(String email) { this.email = email; return this; } // public Builder errorString(String errorString) { this.errorString = errorString; return this; } // // public OAuthInfo build() { // if (errorString == null) { // Preconditions.checkNotNull(token, "You cannot have an empty token when there are no errors"); // Preconditions.checkNotNull(email, "You cannot have an empty email address when there are no errors"); // Preconditions.checkNotNull(authType, "You cannot have a null auth type"); // } // return new OAuthInfo(token, email, errorString, authType); // } // } // } // Path: src/main/java/com/cilogi/shiro/oauth/provider/FacebookAuth.java import javax.inject.Inject; import javax.inject.Named; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Properties; import java.util.logging.Logger; import com.cilogi.shiro.gae.UserAuthType; import com.cilogi.shiro.oauth.OAuthInfo; import org.json.JSONException; import org.json.JSONObject; import org.scribe.builder.ServiceBuilder; import org.scribe.builder.api.FacebookApi; import org.scribe.model.*; import org.scribe.oauth.OAuthService; import org.scribe.utils.OAuthEncoder; // Copyright (c) 2012 Tim Niblett. All Rights Reserved. // // File: FacebookAuth.java (05-Oct-2012) // Author: tim // // Copyright in the whole and every part of this source file belongs to // Tim Niblett (the Author) and may not be used, sold, licenced, // transferred, copied or reproduced in whole or in part in // any manner or form or in or on any media to any person other than // in accordance with the terms of The Author's agreement // or otherwise without the prior written consent of The Author. All // information contained in this source file is confidential information // belonging to The Author and as such may not be disclosed other // than in accordance with the terms of The Author's agreement, or // otherwise, without the prior written consent of The Author. As // confidential information this source file must be kept fully and // effectively secure at all times. // package com.cilogi.shiro.oauth.provider; public class FacebookAuth extends AuthBase implements IOAuthProviderInfo { static final Logger LOG = Logger.getLogger(FacebookAuth.class.getName()); private static final String PROTECTED_RESOURCE_URL = "https://graph.facebook.com/me"; private static final Token EMPTY_TOKEN = null; private final String apiKey; private final String apiSecret; private final String host; @Inject public FacebookAuth(@Named("social.site") String site) { LOG.info("prefix is " + site); String prefix = "fb." + site; Properties props = new Properties(); loadProperties(props, "/social.properties"); apiKey = props.getProperty(prefix + ".apiKey"); apiSecret = props.getProperty(prefix + ".apiSecret"); host = props.getProperty(prefix + ".host"); } @Override
public UserAuthType getUserAuthType() {
cilogi/gaeshiro
src/main/java/com/cilogi/shiro/oauth/provider/FacebookAuth.java
// Path: src/main/java/com/cilogi/shiro/gae/UserAuthType.java // public enum UserAuthType { // CILOGI, GOOGLE, FACEBOOK; // } // // Path: src/main/java/com/cilogi/shiro/oauth/OAuthInfo.java // public class OAuthInfo { // static final Logger LOG = Logger.getLogger(OAuthInfo.class.getName()); // // private final String token; // private final String email; // private final String errorString; // private final UserAuthType userAuthType; // // private OAuthInfo(String token, String email, String errorString, UserAuthType userAuthType) { // this.token = token; // this.email = email; // this.errorString = errorString; // this.userAuthType = userAuthType; // } // // public boolean isError() { // return errorString != null; // } // // public UserAuthType getUserAuthType() { // return userAuthType; // } // // public String getToken() { // return token; // } // // public String getEmail() { // return email; // } // // public String getErrorString() { // return errorString; // } // // public static class Builder { // private String token; // private String email; // private String errorString; // private UserAuthType authType; // // public Builder(UserAuthType authType) { // this.authType = authType; // } // public Builder token(String token) { this.token = token; return this; } // public Builder email(String email) { this.email = email; return this; } // public Builder errorString(String errorString) { this.errorString = errorString; return this; } // // public OAuthInfo build() { // if (errorString == null) { // Preconditions.checkNotNull(token, "You cannot have an empty token when there are no errors"); // Preconditions.checkNotNull(email, "You cannot have an empty email address when there are no errors"); // Preconditions.checkNotNull(authType, "You cannot have a null auth type"); // } // return new OAuthInfo(token, email, errorString, authType); // } // } // }
import javax.inject.Inject; import javax.inject.Named; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Properties; import java.util.logging.Logger; import com.cilogi.shiro.gae.UserAuthType; import com.cilogi.shiro.oauth.OAuthInfo; import org.json.JSONException; import org.json.JSONObject; import org.scribe.builder.ServiceBuilder; import org.scribe.builder.api.FacebookApi; import org.scribe.model.*; import org.scribe.oauth.OAuthService; import org.scribe.utils.OAuthEncoder;
Properties props = new Properties(); loadProperties(props, "/social.properties"); apiKey = props.getProperty(prefix + ".apiKey"); apiSecret = props.getProperty(prefix + ".apiSecret"); host = props.getProperty(prefix + ".host"); } @Override public UserAuthType getUserAuthType() { return UserAuthType.FACEBOOK; } @Override public String loginURL(String callbackUri) { OAuthService service = new ServiceBuilder() .provider(FacebookApi.class) .apiKey(apiKey) .apiSecret(apiSecret) .callback(makeAbsolute(callbackUri, host)) .scope("email") .build(); return service.getAuthorizationUrl(EMPTY_TOKEN); } @Override public String reAuthenticateURL(String callbackUri) { return loginURL(callbackUri)+"&auth_type=reauthenticate"; } @Override
// Path: src/main/java/com/cilogi/shiro/gae/UserAuthType.java // public enum UserAuthType { // CILOGI, GOOGLE, FACEBOOK; // } // // Path: src/main/java/com/cilogi/shiro/oauth/OAuthInfo.java // public class OAuthInfo { // static final Logger LOG = Logger.getLogger(OAuthInfo.class.getName()); // // private final String token; // private final String email; // private final String errorString; // private final UserAuthType userAuthType; // // private OAuthInfo(String token, String email, String errorString, UserAuthType userAuthType) { // this.token = token; // this.email = email; // this.errorString = errorString; // this.userAuthType = userAuthType; // } // // public boolean isError() { // return errorString != null; // } // // public UserAuthType getUserAuthType() { // return userAuthType; // } // // public String getToken() { // return token; // } // // public String getEmail() { // return email; // } // // public String getErrorString() { // return errorString; // } // // public static class Builder { // private String token; // private String email; // private String errorString; // private UserAuthType authType; // // public Builder(UserAuthType authType) { // this.authType = authType; // } // public Builder token(String token) { this.token = token; return this; } // public Builder email(String email) { this.email = email; return this; } // public Builder errorString(String errorString) { this.errorString = errorString; return this; } // // public OAuthInfo build() { // if (errorString == null) { // Preconditions.checkNotNull(token, "You cannot have an empty token when there are no errors"); // Preconditions.checkNotNull(email, "You cannot have an empty email address when there are no errors"); // Preconditions.checkNotNull(authType, "You cannot have a null auth type"); // } // return new OAuthInfo(token, email, errorString, authType); // } // } // } // Path: src/main/java/com/cilogi/shiro/oauth/provider/FacebookAuth.java import javax.inject.Inject; import javax.inject.Named; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Properties; import java.util.logging.Logger; import com.cilogi.shiro.gae.UserAuthType; import com.cilogi.shiro.oauth.OAuthInfo; import org.json.JSONException; import org.json.JSONObject; import org.scribe.builder.ServiceBuilder; import org.scribe.builder.api.FacebookApi; import org.scribe.model.*; import org.scribe.oauth.OAuthService; import org.scribe.utils.OAuthEncoder; Properties props = new Properties(); loadProperties(props, "/social.properties"); apiKey = props.getProperty(prefix + ".apiKey"); apiSecret = props.getProperty(prefix + ".apiSecret"); host = props.getProperty(prefix + ".host"); } @Override public UserAuthType getUserAuthType() { return UserAuthType.FACEBOOK; } @Override public String loginURL(String callbackUri) { OAuthService service = new ServiceBuilder() .provider(FacebookApi.class) .apiKey(apiKey) .apiSecret(apiSecret) .callback(makeAbsolute(callbackUri, host)) .scope("email") .build(); return service.getAuthorizationUrl(EMPTY_TOKEN); } @Override public String reAuthenticateURL(String callbackUri) { return loginURL(callbackUri)+"&auth_type=reauthenticate"; } @Override
public OAuthInfo getUserInfo(String code, String callBackUrl) {
cilogi/gaeshiro
src/main/java/com/cilogi/shiro/oauth/OAuthAuthenticationInfo.java
// Path: src/main/java/com/cilogi/shiro/gae/UserAuthType.java // public enum UserAuthType { // CILOGI, GOOGLE, FACEBOOK; // }
import com.cilogi.shiro.gae.UserAuthType; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.subject.PrincipalCollection; import org.apache.shiro.subject.SimplePrincipalCollection; import java.util.logging.Logger;
// Copyright (c) 2012 Tim Niblett. All Rights Reserved. // // File: OAuthAuthenticationInfo.java (07-Oct-2012) // Author: tim // // Copyright in the whole and every part of this source file belongs to // Tim Niblett (the Author) and may not be used, sold, licenced, // transferred, copied or reproduced in whole or in part in // any manner or form or in or on any media to any person other than // in accordance with the terms of The Author's agreement // or otherwise without the prior written consent of The Author. All // information contained in this source file is confidential information // belonging to The Author and as such may not be disclosed other // than in accordance with the terms of The Author's agreement, or // otherwise, without the prior written consent of The Author. As // confidential information this source file must be kept fully and // effectively secure at all times. // package com.cilogi.shiro.oauth; public class OAuthAuthenticationInfo implements AuthenticationInfo { static final Logger LOG = Logger.getLogger(OAuthAuthenticationInfo.class.getName()); public final String authToken; private final String principal;
// Path: src/main/java/com/cilogi/shiro/gae/UserAuthType.java // public enum UserAuthType { // CILOGI, GOOGLE, FACEBOOK; // } // Path: src/main/java/com/cilogi/shiro/oauth/OAuthAuthenticationInfo.java import com.cilogi.shiro.gae.UserAuthType; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.subject.PrincipalCollection; import org.apache.shiro.subject.SimplePrincipalCollection; import java.util.logging.Logger; // Copyright (c) 2012 Tim Niblett. All Rights Reserved. // // File: OAuthAuthenticationInfo.java (07-Oct-2012) // Author: tim // // Copyright in the whole and every part of this source file belongs to // Tim Niblett (the Author) and may not be used, sold, licenced, // transferred, copied or reproduced in whole or in part in // any manner or form or in or on any media to any person other than // in accordance with the terms of The Author's agreement // or otherwise without the prior written consent of The Author. All // information contained in this source file is confidential information // belonging to The Author and as such may not be disclosed other // than in accordance with the terms of The Author's agreement, or // otherwise, without the prior written consent of The Author. As // confidential information this source file must be kept fully and // effectively secure at all times. // package com.cilogi.shiro.oauth; public class OAuthAuthenticationInfo implements AuthenticationInfo { static final Logger LOG = Logger.getLogger(OAuthAuthenticationInfo.class.getName()); public final String authToken; private final String principal;
private final UserAuthType authType;
ammirate/treemap
com.redhat.thermostat.treemap/main/thermostat/HistogramConverter.java
// Path: com.redhat.thermostat.treemap/main/com/redhat/thermostat/treemap/model/HistogramRecord.java // public class HistogramRecord implements Serializable { // // String classname; // long numberOf; // long totalSize; // // HistogramRecord(String classname) { // this(classname, 0, 0); // } // // public HistogramRecord(String classname, long numberOf, long totalSize) { // this.classname = classname; // this.numberOf = numberOf; // this.totalSize = totalSize; // } // // public String getClassname() { // return classname; // } // // public long getNumberOf() { // return numberOf; // } // // public long getTotalSize() { // return totalSize; // } // // @Override // public boolean equals(Object o) { // if (! (o instanceof HistogramRecord)) { // return false; // } // HistogramRecord other = (HistogramRecord) o; // return Objects.equals(classname, other.classname) && numberOf == other.numberOf && totalSize == other.totalSize; // } // // @Override // public int hashCode() { // return Objects.hash(classname, numberOf, totalSize); // } // } // // Path: com.redhat.thermostat.treemap/main/com/redhat/thermostat/treemap/model/ObjectHistogram.java // public class ObjectHistogram implements Serializable { // // private Map<String, HistogramRecord> histogram = new HashMap<>(); // // public void addThing(Class thing) { // Class clazz = thing.getClass(); // HistogramRecord record = histogram.get(clazz.getName()); // if (record == null) { // record = new HistogramRecord(clazz.getName()); // histogram.put(clazz.getName(), record); // } // record.numberOf++; // record.totalSize += 1;//thing.getSize(); // } // // public Collection<HistogramRecord> getHistogram() { // return histogram.values(); // } // // public void print(PrintStream out) { // for (Map.Entry<String, HistogramRecord> entry : histogram.entrySet()) { // HistogramRecord record = entry.getValue(); // out.println(record.classname + ", " + record.numberOf + ", " + record.totalSize); // } // } // }
import com.redhat.thermostat.treemap.model.HistogramRecord; import com.redhat.thermostat.treemap.model.ObjectHistogram; import java.util.ArrayList; import java.util.List;
/* * Copyright 2012-2015 Red Hat, Inc. * * This file is part of Thermostat. * * Thermostat 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 2, or (at your * option) any later version. * * Thermostat 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 Thermostat; see the file COPYING. If not see * <http://www.gnu.org/licenses/>. * * Linking this code with other modules is making a combined work * based on this code. Thus, the terms and conditions of the GNU * General Public License cover the whole combination. * * As a special exception, the copyright holders of this code give * you permission to link this code with independent modules to * produce an executable, regardless of the license terms of these * independent modules, and to copy and distribute the resulting * executable under terms of your choice, provided that you also * meet, for each linked independent module, the terms and conditions * of the license of that module. An independent module is a module * which is not derived from or based on this code. If you modify * this code, you may extend this exception to your version of the * library, but you are not obligated to do so. If you do not wish * to do so, delete this exception statement from your version. */ package thermostat; /** * This class provides statics function to create a {@link TreeMapNode} tree * from an ObjectHistrogram. */ public class HistogramConverter { /** * The splitter regular expression to split records' className */ private static final String SPLIT_REG_EXP = "\\."; //escaped dot /** * Key used to put into nodes the <i>number of instances</i> information * stored in histogram records. */ private static final String NUMBER_OF = "Number Of Instances"; /** * Call this method to create the full TreeMapNode object corresponding to * the {@link ObjectHistogram} histogram given in input. * @param histrogram the histogram to represent as TreeMapNode * @return the resulting tree */
// Path: com.redhat.thermostat.treemap/main/com/redhat/thermostat/treemap/model/HistogramRecord.java // public class HistogramRecord implements Serializable { // // String classname; // long numberOf; // long totalSize; // // HistogramRecord(String classname) { // this(classname, 0, 0); // } // // public HistogramRecord(String classname, long numberOf, long totalSize) { // this.classname = classname; // this.numberOf = numberOf; // this.totalSize = totalSize; // } // // public String getClassname() { // return classname; // } // // public long getNumberOf() { // return numberOf; // } // // public long getTotalSize() { // return totalSize; // } // // @Override // public boolean equals(Object o) { // if (! (o instanceof HistogramRecord)) { // return false; // } // HistogramRecord other = (HistogramRecord) o; // return Objects.equals(classname, other.classname) && numberOf == other.numberOf && totalSize == other.totalSize; // } // // @Override // public int hashCode() { // return Objects.hash(classname, numberOf, totalSize); // } // } // // Path: com.redhat.thermostat.treemap/main/com/redhat/thermostat/treemap/model/ObjectHistogram.java // public class ObjectHistogram implements Serializable { // // private Map<String, HistogramRecord> histogram = new HashMap<>(); // // public void addThing(Class thing) { // Class clazz = thing.getClass(); // HistogramRecord record = histogram.get(clazz.getName()); // if (record == null) { // record = new HistogramRecord(clazz.getName()); // histogram.put(clazz.getName(), record); // } // record.numberOf++; // record.totalSize += 1;//thing.getSize(); // } // // public Collection<HistogramRecord> getHistogram() { // return histogram.values(); // } // // public void print(PrintStream out) { // for (Map.Entry<String, HistogramRecord> entry : histogram.entrySet()) { // HistogramRecord record = entry.getValue(); // out.println(record.classname + ", " + record.numberOf + ", " + record.totalSize); // } // } // } // Path: com.redhat.thermostat.treemap/main/thermostat/HistogramConverter.java import com.redhat.thermostat.treemap.model.HistogramRecord; import com.redhat.thermostat.treemap.model.ObjectHistogram; import java.util.ArrayList; import java.util.List; /* * Copyright 2012-2015 Red Hat, Inc. * * This file is part of Thermostat. * * Thermostat 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 2, or (at your * option) any later version. * * Thermostat 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 Thermostat; see the file COPYING. If not see * <http://www.gnu.org/licenses/>. * * Linking this code with other modules is making a combined work * based on this code. Thus, the terms and conditions of the GNU * General Public License cover the whole combination. * * As a special exception, the copyright holders of this code give * you permission to link this code with independent modules to * produce an executable, regardless of the license terms of these * independent modules, and to copy and distribute the resulting * executable under terms of your choice, provided that you also * meet, for each linked independent module, the terms and conditions * of the license of that module. An independent module is a module * which is not derived from or based on this code. If you modify * this code, you may extend this exception to your version of the * library, but you are not obligated to do so. If you do not wish * to do so, delete this exception statement from your version. */ package thermostat; /** * This class provides statics function to create a {@link TreeMapNode} tree * from an ObjectHistrogram. */ public class HistogramConverter { /** * The splitter regular expression to split records' className */ private static final String SPLIT_REG_EXP = "\\."; //escaped dot /** * Key used to put into nodes the <i>number of instances</i> information * stored in histogram records. */ private static final String NUMBER_OF = "Number Of Instances"; /** * Call this method to create the full TreeMapNode object corresponding to * the {@link ObjectHistogram} histogram given in input. * @param histrogram the histogram to represent as TreeMapNode * @return the resulting tree */
public static TreeMapNode convertToTreeMap(ObjectHistogram histrogram) {
ammirate/treemap
com.redhat.thermostat.treemap/main/thermostat/HistogramConverter.java
// Path: com.redhat.thermostat.treemap/main/com/redhat/thermostat/treemap/model/HistogramRecord.java // public class HistogramRecord implements Serializable { // // String classname; // long numberOf; // long totalSize; // // HistogramRecord(String classname) { // this(classname, 0, 0); // } // // public HistogramRecord(String classname, long numberOf, long totalSize) { // this.classname = classname; // this.numberOf = numberOf; // this.totalSize = totalSize; // } // // public String getClassname() { // return classname; // } // // public long getNumberOf() { // return numberOf; // } // // public long getTotalSize() { // return totalSize; // } // // @Override // public boolean equals(Object o) { // if (! (o instanceof HistogramRecord)) { // return false; // } // HistogramRecord other = (HistogramRecord) o; // return Objects.equals(classname, other.classname) && numberOf == other.numberOf && totalSize == other.totalSize; // } // // @Override // public int hashCode() { // return Objects.hash(classname, numberOf, totalSize); // } // } // // Path: com.redhat.thermostat.treemap/main/com/redhat/thermostat/treemap/model/ObjectHistogram.java // public class ObjectHistogram implements Serializable { // // private Map<String, HistogramRecord> histogram = new HashMap<>(); // // public void addThing(Class thing) { // Class clazz = thing.getClass(); // HistogramRecord record = histogram.get(clazz.getName()); // if (record == null) { // record = new HistogramRecord(clazz.getName()); // histogram.put(clazz.getName(), record); // } // record.numberOf++; // record.totalSize += 1;//thing.getSize(); // } // // public Collection<HistogramRecord> getHistogram() { // return histogram.values(); // } // // public void print(PrintStream out) { // for (Map.Entry<String, HistogramRecord> entry : histogram.entrySet()) { // HistogramRecord record = entry.getValue(); // out.println(record.classname + ", " + record.numberOf + ", " + record.totalSize); // } // } // }
import com.redhat.thermostat.treemap.model.HistogramRecord; import com.redhat.thermostat.treemap.model.ObjectHistogram; import java.util.ArrayList; import java.util.List;
/* * Copyright 2012-2015 Red Hat, Inc. * * This file is part of Thermostat. * * Thermostat 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 2, or (at your * option) any later version. * * Thermostat 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 Thermostat; see the file COPYING. If not see * <http://www.gnu.org/licenses/>. * * Linking this code with other modules is making a combined work * based on this code. Thus, the terms and conditions of the GNU * General Public License cover the whole combination. * * As a special exception, the copyright holders of this code give * you permission to link this code with independent modules to * produce an executable, regardless of the license terms of these * independent modules, and to copy and distribute the resulting * executable under terms of your choice, provided that you also * meet, for each linked independent module, the terms and conditions * of the license of that module. An independent module is a module * which is not derived from or based on this code. If you modify * this code, you may extend this exception to your version of the * library, but you are not obligated to do so. If you do not wish * to do so, delete this exception statement from your version. */ package thermostat; /** * This class provides statics function to create a {@link TreeMapNode} tree * from an ObjectHistrogram. */ public class HistogramConverter { /** * The splitter regular expression to split records' className */ private static final String SPLIT_REG_EXP = "\\."; //escaped dot /** * Key used to put into nodes the <i>number of instances</i> information * stored in histogram records. */ private static final String NUMBER_OF = "Number Of Instances"; /** * Call this method to create the full TreeMapNode object corresponding to * the {@link ObjectHistogram} histogram given in input. * @param histrogram the histogram to represent as TreeMapNode * @return the resulting tree */ public static TreeMapNode convertToTreeMap(ObjectHistogram histrogram) { TreeMapNode root = new TreeMapNode("", 0);
// Path: com.redhat.thermostat.treemap/main/com/redhat/thermostat/treemap/model/HistogramRecord.java // public class HistogramRecord implements Serializable { // // String classname; // long numberOf; // long totalSize; // // HistogramRecord(String classname) { // this(classname, 0, 0); // } // // public HistogramRecord(String classname, long numberOf, long totalSize) { // this.classname = classname; // this.numberOf = numberOf; // this.totalSize = totalSize; // } // // public String getClassname() { // return classname; // } // // public long getNumberOf() { // return numberOf; // } // // public long getTotalSize() { // return totalSize; // } // // @Override // public boolean equals(Object o) { // if (! (o instanceof HistogramRecord)) { // return false; // } // HistogramRecord other = (HistogramRecord) o; // return Objects.equals(classname, other.classname) && numberOf == other.numberOf && totalSize == other.totalSize; // } // // @Override // public int hashCode() { // return Objects.hash(classname, numberOf, totalSize); // } // } // // Path: com.redhat.thermostat.treemap/main/com/redhat/thermostat/treemap/model/ObjectHistogram.java // public class ObjectHistogram implements Serializable { // // private Map<String, HistogramRecord> histogram = new HashMap<>(); // // public void addThing(Class thing) { // Class clazz = thing.getClass(); // HistogramRecord record = histogram.get(clazz.getName()); // if (record == null) { // record = new HistogramRecord(clazz.getName()); // histogram.put(clazz.getName(), record); // } // record.numberOf++; // record.totalSize += 1;//thing.getSize(); // } // // public Collection<HistogramRecord> getHistogram() { // return histogram.values(); // } // // public void print(PrintStream out) { // for (Map.Entry<String, HistogramRecord> entry : histogram.entrySet()) { // HistogramRecord record = entry.getValue(); // out.println(record.classname + ", " + record.numberOf + ", " + record.totalSize); // } // } // } // Path: com.redhat.thermostat.treemap/main/thermostat/HistogramConverter.java import com.redhat.thermostat.treemap.model.HistogramRecord; import com.redhat.thermostat.treemap.model.ObjectHistogram; import java.util.ArrayList; import java.util.List; /* * Copyright 2012-2015 Red Hat, Inc. * * This file is part of Thermostat. * * Thermostat 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 2, or (at your * option) any later version. * * Thermostat 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 Thermostat; see the file COPYING. If not see * <http://www.gnu.org/licenses/>. * * Linking this code with other modules is making a combined work * based on this code. Thus, the terms and conditions of the GNU * General Public License cover the whole combination. * * As a special exception, the copyright holders of this code give * you permission to link this code with independent modules to * produce an executable, regardless of the license terms of these * independent modules, and to copy and distribute the resulting * executable under terms of your choice, provided that you also * meet, for each linked independent module, the terms and conditions * of the license of that module. An independent module is a module * which is not derived from or based on this code. If you modify * this code, you may extend this exception to your version of the * library, but you are not obligated to do so. If you do not wish * to do so, delete this exception statement from your version. */ package thermostat; /** * This class provides statics function to create a {@link TreeMapNode} tree * from an ObjectHistrogram. */ public class HistogramConverter { /** * The splitter regular expression to split records' className */ private static final String SPLIT_REG_EXP = "\\."; //escaped dot /** * Key used to put into nodes the <i>number of instances</i> information * stored in histogram records. */ private static final String NUMBER_OF = "Number Of Instances"; /** * Call this method to create the full TreeMapNode object corresponding to * the {@link ObjectHistogram} histogram given in input. * @param histrogram the histogram to represent as TreeMapNode * @return the resulting tree */ public static TreeMapNode convertToTreeMap(ObjectHistogram histrogram) { TreeMapNode root = new TreeMapNode("", 0);
List<HistogramRecord> records = new ArrayList<>();
ammirate/treemap
com.redhat.thermostat.treemap/main/thermostat/TreeMapComponent.java
// Path: com.redhat.thermostat.treemap/main/com/redhat/thermostat/treemap/model/ObjectHistogram.java // public class ObjectHistogram implements Serializable { // // private Map<String, HistogramRecord> histogram = new HashMap<>(); // // public void addThing(Class thing) { // Class clazz = thing.getClass(); // HistogramRecord record = histogram.get(clazz.getName()); // if (record == null) { // record = new HistogramRecord(clazz.getName()); // histogram.put(clazz.getName(), record); // } // record.numberOf++; // record.totalSize += 1;//thing.getSize(); // } // // public Collection<HistogramRecord> getHistogram() { // return histogram.values(); // } // // public void print(PrintStream out) { // for (Map.Entry<String, HistogramRecord> entry : histogram.entrySet()) { // HistogramRecord record = entry.getValue(); // out.println(record.classname + ", " + record.numberOf + ", " + record.totalSize); // } // } // }
import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; import java.awt.Point; import java.awt.Rectangle; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.font.FontRenderContext; import java.awt.geom.Rectangle2D; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Objects; import java.util.Stack; import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.border.Border; import javax.swing.border.EmptyBorder; import javax.swing.border.EtchedBorder; import javax.swing.border.LineBorder; import com.redhat.thermostat.treemap.model.ObjectHistogram;
/* * Copyright 2012-2015 Red Hat, Inc. * * This file is part of Thermostat. * * Thermostat 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 2, or (at your * option) any later version. * * Thermostat 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 Thermostat; see the file COPYING. If not see * <http://www.gnu.org/licenses/>. * * Linking this code with other modules is making a combined work * based on this code. Thus, the terms and conditions of the GNU * General Public License cover the whole combination. * * As a special exception, the copyright holders of this code give * you permission to link this code with independent modules to * produce an executable, regardless of the license terms of these * independent modules, and to copy and distribute the resulting * executable under terms of your choice, provided that you also * meet, for each linked independent module, the terms and conditions * of the license of that module. An independent module is a module * which is not derived from or based on this code. If you modify * this code, you may extend this exception to your version of the * library, but you are not obligated to do so. If you do not wish * to do so, delete this exception statement from your version. */ package thermostat; /** * This class allows to represent a hierarchical data structure as a TreeMap. * It extends {@link JComponent} so it can be used like usual Swing objects. * */ public class TreeMapComponent extends JComponent { private static final long serialVersionUID = 1L; /** * TreeMap's graphic root. */ Comp mainComp; /** * Label Object to clone for faster initialization. */ private Label cachedLabel; /** * The tree to render as TreeMap. */ TreeMapNode tree; /** * Horizontal and vertical padding for nested component. */ private final int X_PADDING = TreeProcessor.X_PADDING; private final int Y_PADDING = TreeProcessor.Y_PADDING; /** * Min size for rectangles' sides. rectangles having one or both sides less * than MIN_SIDE pixels will be not drawn. */ private final int MIN_SIDE = 1; /** * Default value for a TreeMap component. */ private static final String TITLE = ""; /** * TreeMap UI Constraint. */ public static final int SIMPLE = 0; public static final int FLAT = 1; public static final int ETCHED_LOWERED = 2; public static final int ETCHED_RAISED = 3; /** * Stores the chosen UI mode. */ private int borderStyle = ETCHED_LOWERED; /** * The components' border */ private Border defaultBorder; /** * Font and size for this component's label. */ private int FONT_SIZE = 8; private Font FONT = (Font) UIManager.get("thermostat-default-font"); /** * Variable in which store last resize dimension. */ private Dimension lastDim; /** * Variable in which store last resize event call time. */ private static long lastCall = 0; /** * Wait time in millisec to resize the TreeMap. */ private final int MIN_DRAGGING_TIME = 60; /** * Stack containing the zoom calls on the TreeMap. */ private Stack<TreeMapNode> zoomStack; /** * This object stores the last clicked rectangle in the TreeMap, in order to * repaint it when another rectangle will be selected. */ private static Comp lastClicked; /** * List of objects observing this. */ private List<TreeMapObserver> observers; /** * Constructor which creates a TreeMapComponent by an histogram object. * @param histogram the histogram to represent as tree map. */
// Path: com.redhat.thermostat.treemap/main/com/redhat/thermostat/treemap/model/ObjectHistogram.java // public class ObjectHistogram implements Serializable { // // private Map<String, HistogramRecord> histogram = new HashMap<>(); // // public void addThing(Class thing) { // Class clazz = thing.getClass(); // HistogramRecord record = histogram.get(clazz.getName()); // if (record == null) { // record = new HistogramRecord(clazz.getName()); // histogram.put(clazz.getName(), record); // } // record.numberOf++; // record.totalSize += 1;//thing.getSize(); // } // // public Collection<HistogramRecord> getHistogram() { // return histogram.values(); // } // // public void print(PrintStream out) { // for (Map.Entry<String, HistogramRecord> entry : histogram.entrySet()) { // HistogramRecord record = entry.getValue(); // out.println(record.classname + ", " + record.numberOf + ", " + record.totalSize); // } // } // } // Path: com.redhat.thermostat.treemap/main/thermostat/TreeMapComponent.java import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; import java.awt.Point; import java.awt.Rectangle; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.font.FontRenderContext; import java.awt.geom.Rectangle2D; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Objects; import java.util.Stack; import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.border.Border; import javax.swing.border.EmptyBorder; import javax.swing.border.EtchedBorder; import javax.swing.border.LineBorder; import com.redhat.thermostat.treemap.model.ObjectHistogram; /* * Copyright 2012-2015 Red Hat, Inc. * * This file is part of Thermostat. * * Thermostat 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 2, or (at your * option) any later version. * * Thermostat 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 Thermostat; see the file COPYING. If not see * <http://www.gnu.org/licenses/>. * * Linking this code with other modules is making a combined work * based on this code. Thus, the terms and conditions of the GNU * General Public License cover the whole combination. * * As a special exception, the copyright holders of this code give * you permission to link this code with independent modules to * produce an executable, regardless of the license terms of these * independent modules, and to copy and distribute the resulting * executable under terms of your choice, provided that you also * meet, for each linked independent module, the terms and conditions * of the license of that module. An independent module is a module * which is not derived from or based on this code. If you modify * this code, you may extend this exception to your version of the * library, but you are not obligated to do so. If you do not wish * to do so, delete this exception statement from your version. */ package thermostat; /** * This class allows to represent a hierarchical data structure as a TreeMap. * It extends {@link JComponent} so it can be used like usual Swing objects. * */ public class TreeMapComponent extends JComponent { private static final long serialVersionUID = 1L; /** * TreeMap's graphic root. */ Comp mainComp; /** * Label Object to clone for faster initialization. */ private Label cachedLabel; /** * The tree to render as TreeMap. */ TreeMapNode tree; /** * Horizontal and vertical padding for nested component. */ private final int X_PADDING = TreeProcessor.X_PADDING; private final int Y_PADDING = TreeProcessor.Y_PADDING; /** * Min size for rectangles' sides. rectangles having one or both sides less * than MIN_SIDE pixels will be not drawn. */ private final int MIN_SIDE = 1; /** * Default value for a TreeMap component. */ private static final String TITLE = ""; /** * TreeMap UI Constraint. */ public static final int SIMPLE = 0; public static final int FLAT = 1; public static final int ETCHED_LOWERED = 2; public static final int ETCHED_RAISED = 3; /** * Stores the chosen UI mode. */ private int borderStyle = ETCHED_LOWERED; /** * The components' border */ private Border defaultBorder; /** * Font and size for this component's label. */ private int FONT_SIZE = 8; private Font FONT = (Font) UIManager.get("thermostat-default-font"); /** * Variable in which store last resize dimension. */ private Dimension lastDim; /** * Variable in which store last resize event call time. */ private static long lastCall = 0; /** * Wait time in millisec to resize the TreeMap. */ private final int MIN_DRAGGING_TIME = 60; /** * Stack containing the zoom calls on the TreeMap. */ private Stack<TreeMapNode> zoomStack; /** * This object stores the last clicked rectangle in the TreeMap, in order to * repaint it when another rectangle will be selected. */ private static Comp lastClicked; /** * List of objects observing this. */ private List<TreeMapObserver> observers; /** * Constructor which creates a TreeMapComponent by an histogram object. * @param histogram the histogram to represent as tree map. */
public TreeMapComponent(ObjectHistogram histogram) {
ammirate/treemap
com.redhat.thermostat.treemap/main/thermostat/TreeMapPanel.java
// Path: com.redhat.thermostat.treemap/main/com/redhat/thermostat/treemap/model/ObjectHistogram.java // public class ObjectHistogram implements Serializable { // // private Map<String, HistogramRecord> histogram = new HashMap<>(); // // public void addThing(Class thing) { // Class clazz = thing.getClass(); // HistogramRecord record = histogram.get(clazz.getName()); // if (record == null) { // record = new HistogramRecord(clazz.getName()); // histogram.put(clazz.getName(), record); // } // record.numberOf++; // record.totalSize += 1;//thing.getSize(); // } // // public Collection<HistogramRecord> getHistogram() { // return histogram.values(); // } // // public void print(PrintStream out) { // for (Map.Entry<String, HistogramRecord> entry : histogram.entrySet()) { // HistogramRecord record = entry.getValue(); // out.println(record.classname + ", " + record.numberOf + ", " + record.totalSize); // } // } // }
import javax.swing.JPanel; import com.redhat.thermostat.treemap.model.ObjectHistogram; import java.awt.BorderLayout; import java.awt.Component;
/* * Copyright 2012-2015 Red Hat, Inc. * * This file is part of Thermostat. * * Thermostat 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 2, or (at your * option) any later version. * * Thermostat 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 Thermostat; see the file COPYING. If not see * <http://www.gnu.org/licenses/>. * * Linking this code with other modules is making a combined work * based on this code. Thus, the terms and conditions of the GNU * General Public License cover the whole combination. * * As a special exception, the copyright holders of this code give * you permission to link this code with independent modules to * produce an executable, regardless of the license terms of these * independent modules, and to copy and distribute the resulting * executable under terms of your choice, provided that you also * meet, for each linked independent module, the terms and conditions * of the license of that module. An independent module is a module * which is not derived from or based on this code. If you modify * this code, you may extend this exception to your version of the * library, but you are not obligated to do so. If you do not wish * to do so, delete this exception statement from your version. */ package thermostat; public class TreeMapPanel extends JPanel { private final JPanel panel; private TreeMapComponent treeMap;
// Path: com.redhat.thermostat.treemap/main/com/redhat/thermostat/treemap/model/ObjectHistogram.java // public class ObjectHistogram implements Serializable { // // private Map<String, HistogramRecord> histogram = new HashMap<>(); // // public void addThing(Class thing) { // Class clazz = thing.getClass(); // HistogramRecord record = histogram.get(clazz.getName()); // if (record == null) { // record = new HistogramRecord(clazz.getName()); // histogram.put(clazz.getName(), record); // } // record.numberOf++; // record.totalSize += 1;//thing.getSize(); // } // // public Collection<HistogramRecord> getHistogram() { // return histogram.values(); // } // // public void print(PrintStream out) { // for (Map.Entry<String, HistogramRecord> entry : histogram.entrySet()) { // HistogramRecord record = entry.getValue(); // out.println(record.classname + ", " + record.numberOf + ", " + record.totalSize); // } // } // } // Path: com.redhat.thermostat.treemap/main/thermostat/TreeMapPanel.java import javax.swing.JPanel; import com.redhat.thermostat.treemap.model.ObjectHistogram; import java.awt.BorderLayout; import java.awt.Component; /* * Copyright 2012-2015 Red Hat, Inc. * * This file is part of Thermostat. * * Thermostat 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 2, or (at your * option) any later version. * * Thermostat 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 Thermostat; see the file COPYING. If not see * <http://www.gnu.org/licenses/>. * * Linking this code with other modules is making a combined work * based on this code. Thus, the terms and conditions of the GNU * General Public License cover the whole combination. * * As a special exception, the copyright holders of this code give * you permission to link this code with independent modules to * produce an executable, regardless of the license terms of these * independent modules, and to copy and distribute the resulting * executable under terms of your choice, provided that you also * meet, for each linked independent module, the terms and conditions * of the license of that module. An independent module is a module * which is not derived from or based on this code. If you modify * this code, you may extend this exception to your version of the * library, but you are not obligated to do so. If you do not wish * to do so, delete this exception statement from your version. */ package thermostat; public class TreeMapPanel extends JPanel { private final JPanel panel; private TreeMapComponent treeMap;
public TreeMapPanel(ObjectHistogram histogram) {
hypercross/minepainter
src/main/java/hx/minepainter/sculpture/Sculpture.java
// Path: src/main/java/hx/utils/Debug.java // public class Debug { // // // public static <T> void log(T... thing){ // StringBuilder sb = new StringBuilder(); // for(T i : thing)sb.append(i + ", "); // System.err.println(sb.toString()); // } // // }
import hx.utils.Debug; import org.lwjgl.util.vector.Matrix; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound;
int index = 0; for(int l = 0; l < layers.length; l ++) if( (layers[l][r.x*8 + r.y] & (1<<r.z)) > 0)index |= (1 << l); return index; } void setIndex(int x, int y,int z, int index){ int prev = getIndex(x,y,z); usage_count[prev]--; usage_count[index]++; r.apply(x, y, z); for(int l = 0; l < layers.length; l ++) if( (index & (1 << l)) > 0) layers[l][r.x*8 + r.y] |= (1<<r.z); else layers[l][r.x*8 + r.y] &= ~(1<<r.z); } public static boolean contains(int x,int y,int z){ return x>=0 && y>=0 && z>=0 && x<8 && y<8 && z<8; } private boolean check(){ if(block_ids == null)return false; if(block_metas == null)return false; if(layers == null)return false; if(r.r == null)return false; for(int i = 0; i <layers.length; i ++){ if(layers[i] == null){
// Path: src/main/java/hx/utils/Debug.java // public class Debug { // // // public static <T> void log(T... thing){ // StringBuilder sb = new StringBuilder(); // for(T i : thing)sb.append(i + ", "); // System.err.println(sb.toString()); // } // // } // Path: src/main/java/hx/minepainter/sculpture/Sculpture.java import hx.utils.Debug; import org.lwjgl.util.vector.Matrix; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; int index = 0; for(int l = 0; l < layers.length; l ++) if( (layers[l][r.x*8 + r.y] & (1<<r.z)) > 0)index |= (1 << l); return index; } void setIndex(int x, int y,int z, int index){ int prev = getIndex(x,y,z); usage_count[prev]--; usage_count[index]++; r.apply(x, y, z); for(int l = 0; l < layers.length; l ++) if( (index & (1 << l)) > 0) layers[l][r.x*8 + r.y] |= (1<<r.z); else layers[l][r.x*8 + r.y] &= ~(1<<r.z); } public static boolean contains(int x,int y,int z){ return x>=0 && y>=0 && z>=0 && x<8 && y<8 && z<8; } private boolean check(){ if(block_ids == null)return false; if(block_metas == null)return false; if(layers == null)return false; if(r.r == null)return false; for(int i = 0; i <layers.length; i ++){ if(layers[i] == null){
Debug.log("layer " + i + " is null!" );
hypercross/minepainter
src/main/java/hx/minepainter/sculpture/SculptureRender.java
// Path: src/main/java/hx/minepainter/ModMinePainter.java // @Mod(modid = "minepainter", version = "0.3.0f1") // public class ModMinePainter { // // public static CreativeTabs tabMinePainter = new CreativeTabs("minepainter"){ // // @Override public Item getTabIconItem() { // return ModMinePainter.mixerbrush.item; // } // // }; // // public static BlockLoader<SculptureBlock> sculpture = // new BlockLoader(new SculptureBlock(), SculptureEntity.class); // public static BlockLoader<PaintingBlock> painting = // new BlockLoader(new PaintingBlock(), PaintingEntity.class); // // public static ItemLoader<Item> handle = new ItemLoader(new Item().setUnlocalizedName("handle").setTextureName("minepainter:handle")); // public static ItemLoader<ChiselItem> chisel = new ItemLoader(new ChiselItem()); // public static ItemLoader<ChiselItem> barcutter = new ItemLoader(new ChiselItem.Barcutter()); // public static ItemLoader<ChiselItem> saw = new ItemLoader(new ChiselItem.Saw()); // public static ItemLoader<PieceItem> piece = new ItemLoader(new PieceItem()); // public static ItemLoader<PieceItem> bar = new ItemLoader(new PieceItem.Bar()); // public static ItemLoader<PieceItem> cover = new ItemLoader(new PieceItem.Cover()); // public static ItemLoader<DroppedSculptureItem> droppedSculpture = new ItemLoader(new DroppedSculptureItem()); // public static ItemLoader<WrenchItem> wrench = new ItemLoader(new WrenchItem()); // public static ItemLoader<CopygunItem> copygun = new ItemLoader(new CopygunItem()); // public static ItemLoader<HingeItem> hinge = new ItemLoader(new HingeItem()); // public static ItemLoader<TransmuterItem> transmuter = new ItemLoader(new TransmuterItem()); // public static ItemLoader<PaintTool> minibrush = new ItemLoader(new PaintTool.Mini()); // public static ItemLoader<PaintTool> mixerbrush = new ItemLoader(new PaintTool.Mixer()); // public static ItemLoader<PaintTool> bucket = new ItemLoader(new PaintTool.Bucket()); // public static ItemLoader<PaintTool> eraser = new ItemLoader(new PaintTool.Eraser()); // public static ItemLoader<Palette> palette = new ItemLoader(new Palette()); // public static ItemLoader<CanvasItem> canvas = new ItemLoader(new CanvasItem()); // // // public static SimpleNetworkWrapper network; // // @EventHandler public void preInit(FMLPreInitializationEvent event){ // Configuration config = new Configuration(event.getSuggestedConfigurationFile()); // config.load(); // if(event.getSide().isClient()) // SculptureRenderCompiler.CULL = config.getBoolean("greedy_culling", "RENDER", true, // "Greedily merge blocks for faster render. Sacrifices AO effect.", "config.greedy_culling"); // Crafting.CRAFTABLE_COPYGUN = config.getBoolean("craftable_copygun", "GAMEPLAY", true, "make copygun craftable"); // config.save(); // } // // @EventHandler // public void init(FMLInitializationEvent e){ // sculpture.load(); // painting.load(); // // handle.load(); // chisel.load(); // barcutter.load(); // saw.load(); // piece.load(); // bar.load(); // cover.load(); // droppedSculpture.load(); // wrench.load(); // copygun.load(); // // hinge.load(); // transmuter.load(); // minibrush.load(); // mixerbrush.load(); // bucket.load(); // eraser.load(); // palette.load(); // canvas.load(); // // new Crafting().registerRecipes(); // // MinecraftForge.EVENT_BUS.register(new hx.minepainter.EventHandler()); // network = NetworkRegistry.INSTANCE.newSimpleChannel("minepainter"); // network.registerMessage(SculptureOperationMessage.SculptureOperationHandler.class, // SculptureOperationMessage.class, 0, Side.SERVER); // network.registerMessage(PaintingOperationMessage.PaintingOperationHandler.class, // PaintingOperationMessage.class, 1, Side.SERVER); // } // // @EventHandler // public void serverLoad(FMLServerStartingEvent event) // { // event.registerServerCommand(new CommandImportPainting()); // } // // @SideOnly(Side.CLIENT) // @EventHandler // public void initClient(FMLInitializationEvent e){ // // sculpture.registerRendering(new SculptureRender(), null); // sculpture.registerRendering(new SculptureRender(), new SculptureEntityRenderer()); // painting.registerRendering(null, new PaintingRenderer()); // // piece.registerRendering(new PieceRenderer()); // bar.registerRendering(new PieceRenderer.Bar()); // cover.registerRendering(new PieceRenderer.Cover()); // droppedSculpture.registerRendering(new DroppedSculptureRenderer()); // canvas.registerRendering(new CanvasRenderer()); // } // }
import hx.minepainter.ModMinePainter; import org.lwjgl.opengl.GL11; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.world.IBlockAccess; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly;
package hx.minepainter.sculpture; @SideOnly(Side.CLIENT) public class SculptureRender implements ISimpleBlockRenderingHandler{ @Override public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { } @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
// Path: src/main/java/hx/minepainter/ModMinePainter.java // @Mod(modid = "minepainter", version = "0.3.0f1") // public class ModMinePainter { // // public static CreativeTabs tabMinePainter = new CreativeTabs("minepainter"){ // // @Override public Item getTabIconItem() { // return ModMinePainter.mixerbrush.item; // } // // }; // // public static BlockLoader<SculptureBlock> sculpture = // new BlockLoader(new SculptureBlock(), SculptureEntity.class); // public static BlockLoader<PaintingBlock> painting = // new BlockLoader(new PaintingBlock(), PaintingEntity.class); // // public static ItemLoader<Item> handle = new ItemLoader(new Item().setUnlocalizedName("handle").setTextureName("minepainter:handle")); // public static ItemLoader<ChiselItem> chisel = new ItemLoader(new ChiselItem()); // public static ItemLoader<ChiselItem> barcutter = new ItemLoader(new ChiselItem.Barcutter()); // public static ItemLoader<ChiselItem> saw = new ItemLoader(new ChiselItem.Saw()); // public static ItemLoader<PieceItem> piece = new ItemLoader(new PieceItem()); // public static ItemLoader<PieceItem> bar = new ItemLoader(new PieceItem.Bar()); // public static ItemLoader<PieceItem> cover = new ItemLoader(new PieceItem.Cover()); // public static ItemLoader<DroppedSculptureItem> droppedSculpture = new ItemLoader(new DroppedSculptureItem()); // public static ItemLoader<WrenchItem> wrench = new ItemLoader(new WrenchItem()); // public static ItemLoader<CopygunItem> copygun = new ItemLoader(new CopygunItem()); // public static ItemLoader<HingeItem> hinge = new ItemLoader(new HingeItem()); // public static ItemLoader<TransmuterItem> transmuter = new ItemLoader(new TransmuterItem()); // public static ItemLoader<PaintTool> minibrush = new ItemLoader(new PaintTool.Mini()); // public static ItemLoader<PaintTool> mixerbrush = new ItemLoader(new PaintTool.Mixer()); // public static ItemLoader<PaintTool> bucket = new ItemLoader(new PaintTool.Bucket()); // public static ItemLoader<PaintTool> eraser = new ItemLoader(new PaintTool.Eraser()); // public static ItemLoader<Palette> palette = new ItemLoader(new Palette()); // public static ItemLoader<CanvasItem> canvas = new ItemLoader(new CanvasItem()); // // // public static SimpleNetworkWrapper network; // // @EventHandler public void preInit(FMLPreInitializationEvent event){ // Configuration config = new Configuration(event.getSuggestedConfigurationFile()); // config.load(); // if(event.getSide().isClient()) // SculptureRenderCompiler.CULL = config.getBoolean("greedy_culling", "RENDER", true, // "Greedily merge blocks for faster render. Sacrifices AO effect.", "config.greedy_culling"); // Crafting.CRAFTABLE_COPYGUN = config.getBoolean("craftable_copygun", "GAMEPLAY", true, "make copygun craftable"); // config.save(); // } // // @EventHandler // public void init(FMLInitializationEvent e){ // sculpture.load(); // painting.load(); // // handle.load(); // chisel.load(); // barcutter.load(); // saw.load(); // piece.load(); // bar.load(); // cover.load(); // droppedSculpture.load(); // wrench.load(); // copygun.load(); // // hinge.load(); // transmuter.load(); // minibrush.load(); // mixerbrush.load(); // bucket.load(); // eraser.load(); // palette.load(); // canvas.load(); // // new Crafting().registerRecipes(); // // MinecraftForge.EVENT_BUS.register(new hx.minepainter.EventHandler()); // network = NetworkRegistry.INSTANCE.newSimpleChannel("minepainter"); // network.registerMessage(SculptureOperationMessage.SculptureOperationHandler.class, // SculptureOperationMessage.class, 0, Side.SERVER); // network.registerMessage(PaintingOperationMessage.PaintingOperationHandler.class, // PaintingOperationMessage.class, 1, Side.SERVER); // } // // @EventHandler // public void serverLoad(FMLServerStartingEvent event) // { // event.registerServerCommand(new CommandImportPainting()); // } // // @SideOnly(Side.CLIENT) // @EventHandler // public void initClient(FMLInitializationEvent e){ // // sculpture.registerRendering(new SculptureRender(), null); // sculpture.registerRendering(new SculptureRender(), new SculptureEntityRenderer()); // painting.registerRendering(null, new PaintingRenderer()); // // piece.registerRendering(new PieceRenderer()); // bar.registerRendering(new PieceRenderer.Bar()); // cover.registerRendering(new PieceRenderer.Cover()); // droppedSculpture.registerRendering(new DroppedSculptureRenderer()); // canvas.registerRendering(new CanvasRenderer()); // } // } // Path: src/main/java/hx/minepainter/sculpture/SculptureRender.java import hx.minepainter.ModMinePainter; import org.lwjgl.opengl.GL11; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.world.IBlockAccess; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; package hx.minepainter.sculpture; @SideOnly(Side.CLIENT) public class SculptureRender implements ISimpleBlockRenderingHandler{ @Override public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { } @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
if(world.getBlock(x, y, z) != ModMinePainter.sculpture.block)return false;
westbury/dwg-lib
src/main/java/com/onespatial/dwglib/bitstreams/BitBuffer.java
// Path: src/main/java/com/onespatial/dwglib/Issues.java // public class Issues { // // public void addWarning(String message) { // System.out.println(message); // // // TODO complete this... // } // // }
import java.text.MessageFormat; import com.onespatial.dwglib.Issues; import java.io.UnsupportedEncodingException;
package com.onespatial.dwglib.bitstreams; /* * Copyright (c) 2016, 1Spatial Group Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ /** * Reads from a byte array on a bit-by-bit basis. Methods are being implemented here to * read fields as per the formats described in chapter 2, Bit Codes and Data Definitions, * of the file format specification. * * @author Nigel Westbury * */ public class BitBuffer { private byte[] byteArray;
// Path: src/main/java/com/onespatial/dwglib/Issues.java // public class Issues { // // public void addWarning(String message) { // System.out.println(message); // // // TODO complete this... // } // // } // Path: src/main/java/com/onespatial/dwglib/bitstreams/BitBuffer.java import java.text.MessageFormat; import com.onespatial.dwglib.Issues; import java.io.UnsupportedEncodingException; package com.onespatial.dwglib.bitstreams; /* * Copyright (c) 2016, 1Spatial Group Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ /** * Reads from a byte array on a bit-by-bit basis. Methods are being implemented here to * read fields as per the formats described in chapter 2, Bit Codes and Data Definitions, * of the file format specification. * * @author Nigel Westbury * */ public class BitBuffer { private byte[] byteArray;
private Issues issues;
westbury/dwg-lib
src/main/java/com/onespatial/dwglib/bitstreams/BitStreams.java
// Path: src/main/java/com/onespatial/dwglib/FileVersion.java // public class FileVersion // { // private final int version; // // public FileVersion(String fileVersionAsString) // { // switch (fileVersionAsString) { // case "AC1015": // // Release 15 // throw new UnsupportedFileVersionException("This file was produced by AutoCAD 2000, 2000i, or 2002. Only files produced by AutoCAD 2010 or later are supported."); // case "AC1018": // // Release 18 // throw new UnsupportedFileVersionException("This file was produced by AutoCAD 2004, 2005, or 2006. Only files produced by AutoCAD 2010 or later are supported."); // case "AC1021": // // Release 21 // throw new UnsupportedFileVersionException("This file was produced by AutoCAD 2007, 2008, or 2009. Only files produced by AutoCAD 2010 or later are supported."); // case "AC1024": // version = 2010; // break; // case "AC1027": // version = 2013; // break; // default: // throw new UnsupportedFileVersionException("DWG format " + fileVersionAsString + " files are not supported. Only files produced by AutoCAD 2010 or later are supported."); // } // // } // // public boolean is2013OrLater() // { // return version >= 2013; // } // // public String getVersionYear() // { // return Integer.toString(version); // } // // } // // Path: src/main/java/com/onespatial/dwglib/Issues.java // public class Issues { // // public void addWarning(String message) { // System.out.println(message); // // // TODO complete this... // } // // }
import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.Arrays; import com.onespatial.dwglib.FileVersion; import com.onespatial.dwglib.Issues;
package com.onespatial.dwglib.bitstreams; /* * Copyright (c) 2016, 1Spatial Group Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ public class BitStreams { private byte[] byteArray;
// Path: src/main/java/com/onespatial/dwglib/FileVersion.java // public class FileVersion // { // private final int version; // // public FileVersion(String fileVersionAsString) // { // switch (fileVersionAsString) { // case "AC1015": // // Release 15 // throw new UnsupportedFileVersionException("This file was produced by AutoCAD 2000, 2000i, or 2002. Only files produced by AutoCAD 2010 or later are supported."); // case "AC1018": // // Release 18 // throw new UnsupportedFileVersionException("This file was produced by AutoCAD 2004, 2005, or 2006. Only files produced by AutoCAD 2010 or later are supported."); // case "AC1021": // // Release 21 // throw new UnsupportedFileVersionException("This file was produced by AutoCAD 2007, 2008, or 2009. Only files produced by AutoCAD 2010 or later are supported."); // case "AC1024": // version = 2010; // break; // case "AC1027": // version = 2013; // break; // default: // throw new UnsupportedFileVersionException("DWG format " + fileVersionAsString + " files are not supported. Only files produced by AutoCAD 2010 or later are supported."); // } // // } // // public boolean is2013OrLater() // { // return version >= 2013; // } // // public String getVersionYear() // { // return Integer.toString(version); // } // // } // // Path: src/main/java/com/onespatial/dwglib/Issues.java // public class Issues { // // public void addWarning(String message) { // System.out.println(message); // // // TODO complete this... // } // // } // Path: src/main/java/com/onespatial/dwglib/bitstreams/BitStreams.java import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.Arrays; import com.onespatial.dwglib.FileVersion; import com.onespatial.dwglib.Issues; package com.onespatial.dwglib.bitstreams; /* * Copyright (c) 2016, 1Spatial Group Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ public class BitStreams { private byte[] byteArray;
private Issues issues;
westbury/dwg-lib
src/main/java/com/onespatial/dwglib/bitstreams/BitStreams.java
// Path: src/main/java/com/onespatial/dwglib/FileVersion.java // public class FileVersion // { // private final int version; // // public FileVersion(String fileVersionAsString) // { // switch (fileVersionAsString) { // case "AC1015": // // Release 15 // throw new UnsupportedFileVersionException("This file was produced by AutoCAD 2000, 2000i, or 2002. Only files produced by AutoCAD 2010 or later are supported."); // case "AC1018": // // Release 18 // throw new UnsupportedFileVersionException("This file was produced by AutoCAD 2004, 2005, or 2006. Only files produced by AutoCAD 2010 or later are supported."); // case "AC1021": // // Release 21 // throw new UnsupportedFileVersionException("This file was produced by AutoCAD 2007, 2008, or 2009. Only files produced by AutoCAD 2010 or later are supported."); // case "AC1024": // version = 2010; // break; // case "AC1027": // version = 2013; // break; // default: // throw new UnsupportedFileVersionException("DWG format " + fileVersionAsString + " files are not supported. Only files produced by AutoCAD 2010 or later are supported."); // } // // } // // public boolean is2013OrLater() // { // return version >= 2013; // } // // public String getVersionYear() // { // return Integer.toString(version); // } // // } // // Path: src/main/java/com/onespatial/dwglib/Issues.java // public class Issues { // // public void addWarning(String message) { // System.out.println(message); // // // TODO complete this... // } // // }
import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.Arrays; import com.onespatial.dwglib.FileVersion; import com.onespatial.dwglib.Issues;
package com.onespatial.dwglib.bitstreams; /* * Copyright (c) 2016, 1Spatial Group Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ public class BitStreams { private byte[] byteArray; private Issues issues; private int dataStreamStart; private int stringStreamStart; private int stringStreamEnd; private int endDataPosition; private int handleStreamEnd;
// Path: src/main/java/com/onespatial/dwglib/FileVersion.java // public class FileVersion // { // private final int version; // // public FileVersion(String fileVersionAsString) // { // switch (fileVersionAsString) { // case "AC1015": // // Release 15 // throw new UnsupportedFileVersionException("This file was produced by AutoCAD 2000, 2000i, or 2002. Only files produced by AutoCAD 2010 or later are supported."); // case "AC1018": // // Release 18 // throw new UnsupportedFileVersionException("This file was produced by AutoCAD 2004, 2005, or 2006. Only files produced by AutoCAD 2010 or later are supported."); // case "AC1021": // // Release 21 // throw new UnsupportedFileVersionException("This file was produced by AutoCAD 2007, 2008, or 2009. Only files produced by AutoCAD 2010 or later are supported."); // case "AC1024": // version = 2010; // break; // case "AC1027": // version = 2013; // break; // default: // throw new UnsupportedFileVersionException("DWG format " + fileVersionAsString + " files are not supported. Only files produced by AutoCAD 2010 or later are supported."); // } // // } // // public boolean is2013OrLater() // { // return version >= 2013; // } // // public String getVersionYear() // { // return Integer.toString(version); // } // // } // // Path: src/main/java/com/onespatial/dwglib/Issues.java // public class Issues { // // public void addWarning(String message) { // System.out.println(message); // // // TODO complete this... // } // // } // Path: src/main/java/com/onespatial/dwglib/bitstreams/BitStreams.java import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.Arrays; import com.onespatial.dwglib.FileVersion; import com.onespatial.dwglib.Issues; package com.onespatial.dwglib.bitstreams; /* * Copyright (c) 2016, 1Spatial Group Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ public class BitStreams { private byte[] byteArray; private Issues issues; private int dataStreamStart; private int stringStreamStart; private int stringStreamEnd; private int endDataPosition; private int handleStreamEnd;
public BitStreams(byte[] byteArray, byte[] signature, FileVersion fileVersion, Issues issues) {
moberwasserlechner/jopencage
src/main/java/com/byteowls/jopencage/model/JOpenCageRate.java
// Path: src/main/java/com/byteowls/jopencage/support/UnixTimestampDeserializer.java // public class UnixTimestampDeserializer extends JsonDeserializer<Date> { // // @Override // public Date deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { // String timestamp = p.getText().trim(); // try { // return new Date(Long.parseLong(timestamp + "000")); // } catch (NumberFormatException ignore) {} // return null; // } // // }
import com.byteowls.jopencage.support.UnixTimestampDeserializer; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.Date;
package com.byteowls.jopencage.model; public class JOpenCageRate { private int limit; private int remaining;
// Path: src/main/java/com/byteowls/jopencage/support/UnixTimestampDeserializer.java // public class UnixTimestampDeserializer extends JsonDeserializer<Date> { // // @Override // public Date deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { // String timestamp = p.getText().trim(); // try { // return new Date(Long.parseLong(timestamp + "000")); // } catch (NumberFormatException ignore) {} // return null; // } // // } // Path: src/main/java/com/byteowls/jopencage/model/JOpenCageRate.java import com.byteowls.jopencage.support.UnixTimestampDeserializer; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.Date; package com.byteowls.jopencage.model; public class JOpenCageRate { private int limit; private int remaining;
@JsonDeserialize(using = UnixTimestampDeserializer.class)
moberwasserlechner/jopencage
src/main/java/com/byteowls/jopencage/model/JOpenCageTimestamp.java
// Path: src/main/java/com/byteowls/jopencage/support/UnixTimestampDeserializer.java // public class UnixTimestampDeserializer extends JsonDeserializer<Date> { // // @Override // public Date deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { // String timestamp = p.getText().trim(); // try { // return new Date(Long.parseLong(timestamp + "000")); // } catch (NumberFormatException ignore) {} // return null; // } // // }
import com.byteowls.jopencage.support.UnixTimestampDeserializer; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.Date;
package com.byteowls.jopencage.model; @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public class JOpenCageTimestamp {
// Path: src/main/java/com/byteowls/jopencage/support/UnixTimestampDeserializer.java // public class UnixTimestampDeserializer extends JsonDeserializer<Date> { // // @Override // public Date deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { // String timestamp = p.getText().trim(); // try { // return new Date(Long.parseLong(timestamp + "000")); // } catch (NumberFormatException ignore) {} // return null; // } // // } // Path: src/main/java/com/byteowls/jopencage/model/JOpenCageTimestamp.java import com.byteowls.jopencage.support.UnixTimestampDeserializer; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.Date; package com.byteowls.jopencage.model; @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public class JOpenCageTimestamp {
@JsonDeserialize(using = UnixTimestampDeserializer.class)
gsh199449/spider
src/main/java/com/gs/spider/controller/home/HomeController.java
// Path: src/main/java/com/gs/spider/controller/BaseController.java // public class BaseController { // private final static Logger LOG = LogManager.getLogger(BaseController.class); // // } // // Path: src/main/java/com/gs/spider/utils/AppInfo.java // public final class AppInfo { // // /*名称*/ // public static String APP_NAME; // // /*版本*/ // public static String APP_VERSION; // // /*在线文档*/ // public static String ONLINE_DOCUMENTATION; // // // static { // Properties appinfo = new Properties(); // try( // InputStreamReader isr = new InputStreamReader(AppInfo.class.getResourceAsStream("/appinfo"),"UTF-8"); // ) { // appinfo.load(isr); // APP_NAME = appinfo.getProperty("appName"); // APP_VERSION= appinfo.getProperty("appVersion"); // ONLINE_DOCUMENTATION= appinfo.getProperty("onlineDocumentation"); // } catch (IOException e) { // } // } // // // }
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; import com.gs.spider.controller.BaseController; import com.gs.spider.utils.AppInfo;
package com.gs.spider.controller.home; /** * Created by gsh199449 on 2016/11/24. */ @Controller @RequestMapping("/")
// Path: src/main/java/com/gs/spider/controller/BaseController.java // public class BaseController { // private final static Logger LOG = LogManager.getLogger(BaseController.class); // // } // // Path: src/main/java/com/gs/spider/utils/AppInfo.java // public final class AppInfo { // // /*名称*/ // public static String APP_NAME; // // /*版本*/ // public static String APP_VERSION; // // /*在线文档*/ // public static String ONLINE_DOCUMENTATION; // // // static { // Properties appinfo = new Properties(); // try( // InputStreamReader isr = new InputStreamReader(AppInfo.class.getResourceAsStream("/appinfo"),"UTF-8"); // ) { // appinfo.load(isr); // APP_NAME = appinfo.getProperty("appName"); // APP_VERSION= appinfo.getProperty("appVersion"); // ONLINE_DOCUMENTATION= appinfo.getProperty("onlineDocumentation"); // } catch (IOException e) { // } // } // // // } // Path: src/main/java/com/gs/spider/controller/home/HomeController.java import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; import com.gs.spider.controller.BaseController; import com.gs.spider.utils.AppInfo; package com.gs.spider.controller.home; /** * Created by gsh199449 on 2016/11/24. */ @Controller @RequestMapping("/")
public class HomeController extends BaseController {
gsh199449/spider
src/main/java/com/gs/spider/controller/home/HomeController.java
// Path: src/main/java/com/gs/spider/controller/BaseController.java // public class BaseController { // private final static Logger LOG = LogManager.getLogger(BaseController.class); // // } // // Path: src/main/java/com/gs/spider/utils/AppInfo.java // public final class AppInfo { // // /*名称*/ // public static String APP_NAME; // // /*版本*/ // public static String APP_VERSION; // // /*在线文档*/ // public static String ONLINE_DOCUMENTATION; // // // static { // Properties appinfo = new Properties(); // try( // InputStreamReader isr = new InputStreamReader(AppInfo.class.getResourceAsStream("/appinfo"),"UTF-8"); // ) { // appinfo.load(isr); // APP_NAME = appinfo.getProperty("appName"); // APP_VERSION= appinfo.getProperty("appVersion"); // ONLINE_DOCUMENTATION= appinfo.getProperty("onlineDocumentation"); // } catch (IOException e) { // } // } // // // }
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; import com.gs.spider.controller.BaseController; import com.gs.spider.utils.AppInfo;
package com.gs.spider.controller.home; /** * Created by gsh199449 on 2016/11/24. */ @Controller @RequestMapping("/") public class HomeController extends BaseController { private final static Logger LOG = LogManager.getLogger(HomeController.class); @RequestMapping(value = {"/", ""}, method = RequestMethod.GET) public ModelAndView home() { ModelAndView modelAndView = new ModelAndView("panel/welcome/welcome");
// Path: src/main/java/com/gs/spider/controller/BaseController.java // public class BaseController { // private final static Logger LOG = LogManager.getLogger(BaseController.class); // // } // // Path: src/main/java/com/gs/spider/utils/AppInfo.java // public final class AppInfo { // // /*名称*/ // public static String APP_NAME; // // /*版本*/ // public static String APP_VERSION; // // /*在线文档*/ // public static String ONLINE_DOCUMENTATION; // // // static { // Properties appinfo = new Properties(); // try( // InputStreamReader isr = new InputStreamReader(AppInfo.class.getResourceAsStream("/appinfo"),"UTF-8"); // ) { // appinfo.load(isr); // APP_NAME = appinfo.getProperty("appName"); // APP_VERSION= appinfo.getProperty("appVersion"); // ONLINE_DOCUMENTATION= appinfo.getProperty("onlineDocumentation"); // } catch (IOException e) { // } // } // // // } // Path: src/main/java/com/gs/spider/controller/home/HomeController.java import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; import com.gs.spider.controller.BaseController; import com.gs.spider.utils.AppInfo; package com.gs.spider.controller.home; /** * Created by gsh199449 on 2016/11/24. */ @Controller @RequestMapping("/") public class HomeController extends BaseController { private final static Logger LOG = LogManager.getLogger(HomeController.class); @RequestMapping(value = {"/", ""}, method = RequestMethod.GET) public ModelAndView home() { ModelAndView modelAndView = new ModelAndView("panel/welcome/welcome");
modelAndView.addObject("appName", AppInfo.APP_NAME)
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/RxErrorHandler.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/listener/ResponseErrorListener.java // public interface ResponseErrorListener { // void handleResponseError(Context context, Throwable t); // // ResponseErrorListener EMPTY = new ResponseErrorListener() { // @Override // public void handleResponseError(Context context, Throwable t) { // // } // }; // }
import android.content.Context; import vn.eazy.base.mvp.intergration.handler.error.listener.ResponseErrorListener;
package vn.eazy.base.mvp.intergration.handler.error; /** * Created by harryle on 6/23/17. */ public class RxErrorHandler { public final String TAG = this.getClass().getSimpleName(); private ErrorHandlerFactory mHandlerFactory; public RxErrorHandler(Builder builder) { this.mHandlerFactory = builder.errorHandlerFactory; } public static Builder builder() { return new Builder(); } public ErrorHandlerFactory getHandlerFactory() { return mHandlerFactory; } public static final class Builder { private Context context;
// Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/listener/ResponseErrorListener.java // public interface ResponseErrorListener { // void handleResponseError(Context context, Throwable t); // // ResponseErrorListener EMPTY = new ResponseErrorListener() { // @Override // public void handleResponseError(Context context, Throwable t) { // // } // }; // } // Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/RxErrorHandler.java import android.content.Context; import vn.eazy.base.mvp.intergration.handler.error.listener.ResponseErrorListener; package vn.eazy.base.mvp.intergration.handler.error; /** * Created by harryle on 6/23/17. */ public class RxErrorHandler { public final String TAG = this.getClass().getSimpleName(); private ErrorHandlerFactory mHandlerFactory; public RxErrorHandler(Builder builder) { this.mHandlerFactory = builder.errorHandlerFactory; } public static Builder builder() { return new Builder(); } public ErrorHandlerFactory getHandlerFactory() { return mHandlerFactory; } public static final class Builder { private Context context;
private ResponseErrorListener mResponseErrorListener;
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/intergration/ActivityLifeCycle.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/ActivityDelegate.java // public class ActivityDelegate implements Activity, Serializable { // public static final String ACTIVITY_DELEGATE = "activity_delegate"; // // private android.app.Activity mActivity; // private IActivity iActivity; // // public ActivityDelegate(android.app.Activity activity) { // this.mActivity = activity; // this.iActivity = (IActivity) activity; // } // // @Override // public void onCreate(Bundle savedInstanceState) { // iActivity.setupActivityComponent(((App) mActivity.getApplication()).getAppComponent()); // int layoutResId = iActivity.initView(savedInstanceState); // if (layoutResId != 0) { // mActivity.setContentView(layoutResId); // } else { // throw new RuntimeException("LayoutResID isn't illegal. Please check it again."); // } // iActivity.initData(savedInstanceState); // } // // @Override // public void onDestroy() { // this.iActivity = null; // this.mActivity = null; // } // // @Override // public void onStart() { // // } // // @Override // public void onResume() { // // } // // @Override // public void onPause() { // // } // // @Override // public void onSaveInstanceState(Bundle outState) { // // } // // @Override // public void onStop() { // // } // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/IActivity.java // public interface IActivity { // /** // * // * @param appComponent // */ // void setupActivityComponent(AppComponent appComponent); // // /** // * @param savedInstanceState // * @return // */ // int initView(Bundle savedInstanceState); // // /** // * @param savedInstanceState // */ // void initData(Bundle savedInstanceState); // }
import android.app.Activity; import android.app.Application; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.util.Log; import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.inject.Inject; import javax.inject.Singleton; import vn.eazy.base.mvp.delegate.ActivityDelegate; import vn.eazy.base.mvp.delegate.IActivity;
package vn.eazy.base.mvp.intergration; /** * Created by harryle on 6/18/17. */ @Singleton public class ActivityLifeCycle implements Application.ActivityLifecycleCallbacks { private Application mApplication; private Map<String, Object> mExtras; private FragmentLifeCycle mFragmentLifeCycle; private List<FragmentManager.FragmentLifecycleCallbacks> mFragmentLifeCycles; @Inject public ActivityLifeCycle(Application application, Map<String, Object> extras) { this.mApplication = application; this.mExtras = extras; } @Override public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
// Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/ActivityDelegate.java // public class ActivityDelegate implements Activity, Serializable { // public static final String ACTIVITY_DELEGATE = "activity_delegate"; // // private android.app.Activity mActivity; // private IActivity iActivity; // // public ActivityDelegate(android.app.Activity activity) { // this.mActivity = activity; // this.iActivity = (IActivity) activity; // } // // @Override // public void onCreate(Bundle savedInstanceState) { // iActivity.setupActivityComponent(((App) mActivity.getApplication()).getAppComponent()); // int layoutResId = iActivity.initView(savedInstanceState); // if (layoutResId != 0) { // mActivity.setContentView(layoutResId); // } else { // throw new RuntimeException("LayoutResID isn't illegal. Please check it again."); // } // iActivity.initData(savedInstanceState); // } // // @Override // public void onDestroy() { // this.iActivity = null; // this.mActivity = null; // } // // @Override // public void onStart() { // // } // // @Override // public void onResume() { // // } // // @Override // public void onPause() { // // } // // @Override // public void onSaveInstanceState(Bundle outState) { // // } // // @Override // public void onStop() { // // } // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/IActivity.java // public interface IActivity { // /** // * // * @param appComponent // */ // void setupActivityComponent(AppComponent appComponent); // // /** // * @param savedInstanceState // * @return // */ // int initView(Bundle savedInstanceState); // // /** // * @param savedInstanceState // */ // void initData(Bundle savedInstanceState); // } // Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/ActivityLifeCycle.java import android.app.Activity; import android.app.Application; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.util.Log; import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.inject.Inject; import javax.inject.Singleton; import vn.eazy.base.mvp.delegate.ActivityDelegate; import vn.eazy.base.mvp.delegate.IActivity; package vn.eazy.base.mvp.intergration; /** * Created by harryle on 6/18/17. */ @Singleton public class ActivityLifeCycle implements Application.ActivityLifecycleCallbacks { private Application mApplication; private Map<String, Object> mExtras; private FragmentLifeCycle mFragmentLifeCycle; private List<FragmentManager.FragmentLifecycleCallbacks> mFragmentLifeCycles; @Inject public ActivityLifeCycle(Application application, Map<String, Object> extras) { this.mApplication = application; this.mExtras = extras; } @Override public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
if (activity instanceof IActivity && activity.getIntent() != null) {
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/intergration/ActivityLifeCycle.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/ActivityDelegate.java // public class ActivityDelegate implements Activity, Serializable { // public static final String ACTIVITY_DELEGATE = "activity_delegate"; // // private android.app.Activity mActivity; // private IActivity iActivity; // // public ActivityDelegate(android.app.Activity activity) { // this.mActivity = activity; // this.iActivity = (IActivity) activity; // } // // @Override // public void onCreate(Bundle savedInstanceState) { // iActivity.setupActivityComponent(((App) mActivity.getApplication()).getAppComponent()); // int layoutResId = iActivity.initView(savedInstanceState); // if (layoutResId != 0) { // mActivity.setContentView(layoutResId); // } else { // throw new RuntimeException("LayoutResID isn't illegal. Please check it again."); // } // iActivity.initData(savedInstanceState); // } // // @Override // public void onDestroy() { // this.iActivity = null; // this.mActivity = null; // } // // @Override // public void onStart() { // // } // // @Override // public void onResume() { // // } // // @Override // public void onPause() { // // } // // @Override // public void onSaveInstanceState(Bundle outState) { // // } // // @Override // public void onStop() { // // } // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/IActivity.java // public interface IActivity { // /** // * // * @param appComponent // */ // void setupActivityComponent(AppComponent appComponent); // // /** // * @param savedInstanceState // * @return // */ // int initView(Bundle savedInstanceState); // // /** // * @param savedInstanceState // */ // void initData(Bundle savedInstanceState); // }
import android.app.Activity; import android.app.Application; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.util.Log; import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.inject.Inject; import javax.inject.Singleton; import vn.eazy.base.mvp.delegate.ActivityDelegate; import vn.eazy.base.mvp.delegate.IActivity;
package vn.eazy.base.mvp.intergration; /** * Created by harryle on 6/18/17. */ @Singleton public class ActivityLifeCycle implements Application.ActivityLifecycleCallbacks { private Application mApplication; private Map<String, Object> mExtras; private FragmentLifeCycle mFragmentLifeCycle; private List<FragmentManager.FragmentLifecycleCallbacks> mFragmentLifeCycles; @Inject public ActivityLifeCycle(Application application, Map<String, Object> extras) { this.mApplication = application; this.mExtras = extras; } @Override public void onActivityCreated(Activity activity, Bundle savedInstanceState) { if (activity instanceof IActivity && activity.getIntent() != null) {
// Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/ActivityDelegate.java // public class ActivityDelegate implements Activity, Serializable { // public static final String ACTIVITY_DELEGATE = "activity_delegate"; // // private android.app.Activity mActivity; // private IActivity iActivity; // // public ActivityDelegate(android.app.Activity activity) { // this.mActivity = activity; // this.iActivity = (IActivity) activity; // } // // @Override // public void onCreate(Bundle savedInstanceState) { // iActivity.setupActivityComponent(((App) mActivity.getApplication()).getAppComponent()); // int layoutResId = iActivity.initView(savedInstanceState); // if (layoutResId != 0) { // mActivity.setContentView(layoutResId); // } else { // throw new RuntimeException("LayoutResID isn't illegal. Please check it again."); // } // iActivity.initData(savedInstanceState); // } // // @Override // public void onDestroy() { // this.iActivity = null; // this.mActivity = null; // } // // @Override // public void onStart() { // // } // // @Override // public void onResume() { // // } // // @Override // public void onPause() { // // } // // @Override // public void onSaveInstanceState(Bundle outState) { // // } // // @Override // public void onStop() { // // } // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/IActivity.java // public interface IActivity { // /** // * // * @param appComponent // */ // void setupActivityComponent(AppComponent appComponent); // // /** // * @param savedInstanceState // * @return // */ // int initView(Bundle savedInstanceState); // // /** // * @param savedInstanceState // */ // void initData(Bundle savedInstanceState); // } // Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/ActivityLifeCycle.java import android.app.Activity; import android.app.Application; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.util.Log; import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.inject.Inject; import javax.inject.Singleton; import vn.eazy.base.mvp.delegate.ActivityDelegate; import vn.eazy.base.mvp.delegate.IActivity; package vn.eazy.base.mvp.intergration; /** * Created by harryle on 6/18/17. */ @Singleton public class ActivityLifeCycle implements Application.ActivityLifecycleCallbacks { private Application mApplication; private Map<String, Object> mExtras; private FragmentLifeCycle mFragmentLifeCycle; private List<FragmentManager.FragmentLifecycleCallbacks> mFragmentLifeCycles; @Inject public ActivityLifeCycle(Application application, Map<String, Object> extras) { this.mApplication = application; this.mExtras = extras; } @Override public void onActivityCreated(Activity activity, Bundle savedInstanceState) { if (activity instanceof IActivity && activity.getIntent() != null) {
ActivityDelegate activityDelegate = getActivityDelegate(activity);
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/helper/FragmentHelper.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/base/fragment/BaseFragment.java // public abstract class BaseFragment<P extends IPresenter> extends RxFragment implements IFragment { // @Inject // public P mPresenter; // // protected View rootView; // private Unbinder unbinder; // private OnCallbackListener callbackListener; // // public interface OnCallbackListener { // void onCallback(CallbackObject callbackObject); // } // // @Override // public void onCreate(@Nullable Bundle savedInstanceState) { // super.onCreate(savedInstanceState); // setRetainInstance(true); // } // // @Nullable // @Override // public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { // preInitLayout(); // rootView = LayoutInflater.from(getContext()).inflate(getLayoutId(), container, false); // unbinder = ButterKnife.bind(this, rootView); // return rootView; // } // // public void preInitLayout() { // } // // @Override // public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { // super.onViewCreated(view, savedInstanceState); // bindView(); // bindMenu(); // } // // @Override // public void onDestroyView() { // super.onDestroyView(); // unBindView(); // unBindMenu(); // } // // @Override // public void onDestroy() { // super.onDestroy(); // if (mPresenter != null) { // mPresenter.onDestroy(); // } // mPresenter = null; // } // // public abstract int getLayoutId(); // // public void bindView() { // } // // public void unBindView() { // if (unbinder != null) { // unbinder.unbind(); // } // } // // public void bindMenu() { // } // // public void unBindMenu() { // } // // public BaseActivity getBaseActivity() { // if (getActivity() instanceof BaseActivity) { // return (BaseActivity) getActivity(); // } else { // throw new NullPointerException("Can't cast this activity to BaseActivity"); // } // } // // public OnCallbackListener getCallbackListener() { // return callbackListener; // } // // public void setCallbackListener(OnCallbackListener callbackListener) { // this.callbackListener = callbackListener; // } // // public FragmentHelper getFragmentHelper() { // if (getBaseActivity() instanceof BaseMainActivity) { // return ((BaseMainActivity) getBaseActivity()).fragmentHelper; // } else { // throw new NullPointerException("Can't find Fragment Helper"); // } // } // // }
import android.os.Build; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.view.View; import java.util.List; import vn.eazy.base.mvp.R; import vn.eazy.base.mvp.base.fragment.BaseFragment;
package vn.eazy.base.mvp.helper; /** * Created by Harry on 12/24/16. */ public class FragmentHelper implements OnFragmentAction { private FragmentManager fragmentManager; private int idContent = R.id.fragment_content; public FragmentHelper(FragmentManager fragmentManager, int idContent) { this.fragmentManager = fragmentManager; this.idContent = idContent; } @Override
// Path: code/base/src/main/java/vn/eazy/base/mvp/base/fragment/BaseFragment.java // public abstract class BaseFragment<P extends IPresenter> extends RxFragment implements IFragment { // @Inject // public P mPresenter; // // protected View rootView; // private Unbinder unbinder; // private OnCallbackListener callbackListener; // // public interface OnCallbackListener { // void onCallback(CallbackObject callbackObject); // } // // @Override // public void onCreate(@Nullable Bundle savedInstanceState) { // super.onCreate(savedInstanceState); // setRetainInstance(true); // } // // @Nullable // @Override // public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { // preInitLayout(); // rootView = LayoutInflater.from(getContext()).inflate(getLayoutId(), container, false); // unbinder = ButterKnife.bind(this, rootView); // return rootView; // } // // public void preInitLayout() { // } // // @Override // public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { // super.onViewCreated(view, savedInstanceState); // bindView(); // bindMenu(); // } // // @Override // public void onDestroyView() { // super.onDestroyView(); // unBindView(); // unBindMenu(); // } // // @Override // public void onDestroy() { // super.onDestroy(); // if (mPresenter != null) { // mPresenter.onDestroy(); // } // mPresenter = null; // } // // public abstract int getLayoutId(); // // public void bindView() { // } // // public void unBindView() { // if (unbinder != null) { // unbinder.unbind(); // } // } // // public void bindMenu() { // } // // public void unBindMenu() { // } // // public BaseActivity getBaseActivity() { // if (getActivity() instanceof BaseActivity) { // return (BaseActivity) getActivity(); // } else { // throw new NullPointerException("Can't cast this activity to BaseActivity"); // } // } // // public OnCallbackListener getCallbackListener() { // return callbackListener; // } // // public void setCallbackListener(OnCallbackListener callbackListener) { // this.callbackListener = callbackListener; // } // // public FragmentHelper getFragmentHelper() { // if (getBaseActivity() instanceof BaseMainActivity) { // return ((BaseMainActivity) getBaseActivity()).fragmentHelper; // } else { // throw new NullPointerException("Can't find Fragment Helper"); // } // } // // } // Path: code/base/src/main/java/vn/eazy/base/mvp/helper/FragmentHelper.java import android.os.Build; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.view.View; import java.util.List; import vn.eazy.base.mvp.R; import vn.eazy.base.mvp.base.fragment.BaseFragment; package vn.eazy.base.mvp.helper; /** * Created by Harry on 12/24/16. */ public class FragmentHelper implements OnFragmentAction { private FragmentManager fragmentManager; private int idContent = R.id.fragment_content; public FragmentHelper(FragmentManager fragmentManager, int idContent) { this.fragmentManager = fragmentManager; this.idContent = idContent; } @Override
public void replaceFragment(int id, BaseFragment baseFragment) {
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/di/module/AppModule.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/IRepositoryManager.java // public interface IRepositoryManager { // /** // * @param services // */ // void injectRetrofitService(Class<?>... services); // // /** // * @param service // * @param <T> // * @return // */ // <T> T obtainRetrofitServices(Class<T> service); // // // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/RepositoryManager.java // @Singleton // public class RepositoryManager implements IRepositoryManager { // private Retrofit mRetrofit; // // private final Map<String, Object> mRetrofitServiceCache = new LinkedHashMap<>(); // // @Inject // public RepositoryManager(Retrofit retrofit) { // this.mRetrofit = retrofit; // } // // @Override // public void injectRetrofitService(Class<?>... services) { // for (Class<?> service : services) { // if (!mRetrofitServiceCache.containsKey(service.getSimpleName())) { // mRetrofitServiceCache.put(service.getSimpleName(), mRetrofit.create(service)); // } // } // } // // @Override // public <T> T obtainRetrofitServices(Class<T> service) { // PreConditions.checkState(mRetrofitServiceCache.containsKey(service.getSimpleName()), // "Unable find " + service.getSimpleName() + ",first call injectRetrofitServices it in ConfigModule"); // return (T) mRetrofitServiceCache.get(service.getSimpleName()); // } // }
import android.app.Application; import android.content.Context; import android.os.Handler; import android.support.annotation.Nullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import java.util.HashMap; import java.util.Map; import javax.inject.Singleton; import dagger.Module; import dagger.Provides; import vn.eazy.base.mvp.intergration.IRepositoryManager; import vn.eazy.base.mvp.intergration.RepositoryManager;
package vn.eazy.base.mvp.di.module; /** * Created by harryle on 6/17/17. */ @Module public class AppModule { private Application mApplication; public AppModule(Application application) { this.mApplication = application; } @Provides @Singleton public Application provideApplication() { return mApplication; } @Provides @Singleton public Gson provideGson(Application application, @Nullable GsonConfiguration configuration) { GsonBuilder builder = new GsonBuilder(); if (configuration != null) { configuration.configGson(application, builder); } return builder.create(); } @Provides @Singleton public Handler provideHandler() { return new Handler(); } @Provides @Singleton
// Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/IRepositoryManager.java // public interface IRepositoryManager { // /** // * @param services // */ // void injectRetrofitService(Class<?>... services); // // /** // * @param service // * @param <T> // * @return // */ // <T> T obtainRetrofitServices(Class<T> service); // // // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/RepositoryManager.java // @Singleton // public class RepositoryManager implements IRepositoryManager { // private Retrofit mRetrofit; // // private final Map<String, Object> mRetrofitServiceCache = new LinkedHashMap<>(); // // @Inject // public RepositoryManager(Retrofit retrofit) { // this.mRetrofit = retrofit; // } // // @Override // public void injectRetrofitService(Class<?>... services) { // for (Class<?> service : services) { // if (!mRetrofitServiceCache.containsKey(service.getSimpleName())) { // mRetrofitServiceCache.put(service.getSimpleName(), mRetrofit.create(service)); // } // } // } // // @Override // public <T> T obtainRetrofitServices(Class<T> service) { // PreConditions.checkState(mRetrofitServiceCache.containsKey(service.getSimpleName()), // "Unable find " + service.getSimpleName() + ",first call injectRetrofitServices it in ConfigModule"); // return (T) mRetrofitServiceCache.get(service.getSimpleName()); // } // } // Path: code/base/src/main/java/vn/eazy/base/mvp/di/module/AppModule.java import android.app.Application; import android.content.Context; import android.os.Handler; import android.support.annotation.Nullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import java.util.HashMap; import java.util.Map; import javax.inject.Singleton; import dagger.Module; import dagger.Provides; import vn.eazy.base.mvp.intergration.IRepositoryManager; import vn.eazy.base.mvp.intergration.RepositoryManager; package vn.eazy.base.mvp.di.module; /** * Created by harryle on 6/17/17. */ @Module public class AppModule { private Application mApplication; public AppModule(Application application) { this.mApplication = application; } @Provides @Singleton public Application provideApplication() { return mApplication; } @Provides @Singleton public Gson provideGson(Application application, @Nullable GsonConfiguration configuration) { GsonBuilder builder = new GsonBuilder(); if (configuration != null) { configuration.configGson(application, builder); } return builder.create(); } @Provides @Singleton public Handler provideHandler() { return new Handler(); } @Provides @Singleton
public IRepositoryManager provideRepositoryManager(RepositoryManager repositoryManager) {
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/di/module/AppModule.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/IRepositoryManager.java // public interface IRepositoryManager { // /** // * @param services // */ // void injectRetrofitService(Class<?>... services); // // /** // * @param service // * @param <T> // * @return // */ // <T> T obtainRetrofitServices(Class<T> service); // // // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/RepositoryManager.java // @Singleton // public class RepositoryManager implements IRepositoryManager { // private Retrofit mRetrofit; // // private final Map<String, Object> mRetrofitServiceCache = new LinkedHashMap<>(); // // @Inject // public RepositoryManager(Retrofit retrofit) { // this.mRetrofit = retrofit; // } // // @Override // public void injectRetrofitService(Class<?>... services) { // for (Class<?> service : services) { // if (!mRetrofitServiceCache.containsKey(service.getSimpleName())) { // mRetrofitServiceCache.put(service.getSimpleName(), mRetrofit.create(service)); // } // } // } // // @Override // public <T> T obtainRetrofitServices(Class<T> service) { // PreConditions.checkState(mRetrofitServiceCache.containsKey(service.getSimpleName()), // "Unable find " + service.getSimpleName() + ",first call injectRetrofitServices it in ConfigModule"); // return (T) mRetrofitServiceCache.get(service.getSimpleName()); // } // }
import android.app.Application; import android.content.Context; import android.os.Handler; import android.support.annotation.Nullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import java.util.HashMap; import java.util.Map; import javax.inject.Singleton; import dagger.Module; import dagger.Provides; import vn.eazy.base.mvp.intergration.IRepositoryManager; import vn.eazy.base.mvp.intergration.RepositoryManager;
package vn.eazy.base.mvp.di.module; /** * Created by harryle on 6/17/17. */ @Module public class AppModule { private Application mApplication; public AppModule(Application application) { this.mApplication = application; } @Provides @Singleton public Application provideApplication() { return mApplication; } @Provides @Singleton public Gson provideGson(Application application, @Nullable GsonConfiguration configuration) { GsonBuilder builder = new GsonBuilder(); if (configuration != null) { configuration.configGson(application, builder); } return builder.create(); } @Provides @Singleton public Handler provideHandler() { return new Handler(); } @Provides @Singleton
// Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/IRepositoryManager.java // public interface IRepositoryManager { // /** // * @param services // */ // void injectRetrofitService(Class<?>... services); // // /** // * @param service // * @param <T> // * @return // */ // <T> T obtainRetrofitServices(Class<T> service); // // // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/RepositoryManager.java // @Singleton // public class RepositoryManager implements IRepositoryManager { // private Retrofit mRetrofit; // // private final Map<String, Object> mRetrofitServiceCache = new LinkedHashMap<>(); // // @Inject // public RepositoryManager(Retrofit retrofit) { // this.mRetrofit = retrofit; // } // // @Override // public void injectRetrofitService(Class<?>... services) { // for (Class<?> service : services) { // if (!mRetrofitServiceCache.containsKey(service.getSimpleName())) { // mRetrofitServiceCache.put(service.getSimpleName(), mRetrofit.create(service)); // } // } // } // // @Override // public <T> T obtainRetrofitServices(Class<T> service) { // PreConditions.checkState(mRetrofitServiceCache.containsKey(service.getSimpleName()), // "Unable find " + service.getSimpleName() + ",first call injectRetrofitServices it in ConfigModule"); // return (T) mRetrofitServiceCache.get(service.getSimpleName()); // } // } // Path: code/base/src/main/java/vn/eazy/base/mvp/di/module/AppModule.java import android.app.Application; import android.content.Context; import android.os.Handler; import android.support.annotation.Nullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import java.util.HashMap; import java.util.Map; import javax.inject.Singleton; import dagger.Module; import dagger.Provides; import vn.eazy.base.mvp.intergration.IRepositoryManager; import vn.eazy.base.mvp.intergration.RepositoryManager; package vn.eazy.base.mvp.di.module; /** * Created by harryle on 6/17/17. */ @Module public class AppModule { private Application mApplication; public AppModule(Application application) { this.mApplication = application; } @Provides @Singleton public Application provideApplication() { return mApplication; } @Provides @Singleton public Gson provideGson(Application application, @Nullable GsonConfiguration configuration) { GsonBuilder builder = new GsonBuilder(); if (configuration != null) { configuration.configGson(application, builder); } return builder.create(); } @Provides @Singleton public Handler provideHandler() { return new Handler(); } @Provides @Singleton
public IRepositoryManager provideRepositoryManager(RepositoryManager repositoryManager) {
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/base/OnBaseActionListener.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/toolbar/ToolbarHelper.java // public class ToolbarHelper implements OnToolbarAction { // protected Toolbar toolbar; // protected AppCompatTextView leftBtn; // protected AppCompatTextView tvTitle; // protected AppCompatTextView rightBtn; // protected Context context; // // public ToolbarHelper(Toolbar toolbar) throws IllegalAccessException { // this.toolbar = toolbar; // context = toolbar.getContext(); // leftBtn = (AppCompatTextView) toolbar.findViewById(R.id.left_button); // rightBtn = (AppCompatTextView) toolbar.findViewById(R.id.right_button); // if (rightBtn == null) { // throw new IllegalAccessException("Can't find this right button."); // } else { // rightBtn.setClickable(true); // } // if (leftBtn == null) { // throw new IllegalAccessException("Can't find this Left button"); // } else { // leftBtn.setClickable(true); // } // tvTitle = (AppCompatTextView) toolbar.findViewById(R.id.tvTitleToolbar); // if (tvTitle == null) { // throw new IllegalAccessException("Can't find this Title TextView"); // } else { // tvTitle.setClickable(true); // } // } // // @Override // public void setTitle(@NonNull String title) { // if (toolbar != null) // setTitle(title, ""); // } // // @Override // public void setTitle(@NonNull String title, @NonNull String font) { // tvTitle.setText(title); // if (!TextUtils.isEmpty(font)) { // tvTitle.setTypeface(Typeface.createFromAsset(tvTitle.getContext().getAssets(), font)); // } // } // // @Override // public void setTitleMainColor(int color) { // if (toolbar != null) // tvTitle.setTextColor(color); // } // // @Override // public void showToolbar(boolean isShow) { // if (toolbar != null) // if (isShow) { // toolbar.setVisibility(View.VISIBLE); // } else { // toolbar.setVisibility(View.GONE); // } // } // // @Override // public void showLeftButton(boolean isShow) { // showLeftButton(isShow, null); // } // // @Override // public void showLeftButton(boolean isShow, View.OnClickListener onClickListener) { // leftBtn.setVisibility(isShow ? View.VISIBLE : View.INVISIBLE); // if (onClickListener != null) { // leftBtn.setOnClickListener(onClickListener); // } // } // // @Override // public void showLeftButton(@Nullable int iconRes, View.OnClickListener onClickListener) { // leftBtn.setText(""); // leftBtn.setCompoundDrawablesWithIntrinsicBounds(ContextCompat.getDrawable(context, iconRes), null, null, null); // leftBtn.setOnClickListener(onClickListener); // showLeftButton(true); // } // // @Override // public void showLeftButton(@Nullable String text, View.OnClickListener onClickListener) { // leftBtn.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null); // leftBtn.setText(Html.fromHtml(text)); // leftBtn.setOnClickListener(onClickListener); // showLeftButton(true); // } // // // @Override // public void showRightButton(boolean isShow) { // rightBtn.setVisibility(isShow ? View.VISIBLE : View.INVISIBLE); // } // // @Override // public void showRightButton(@Nullable String text, View.OnClickListener onClickListener) { // rightBtn.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null); // rightBtn.setText(Html.fromHtml(text)); // rightBtn.setOnClickListener(onClickListener); // } // // @Override // public void showRightButton(@Nullable int iconRes, View.OnClickListener onClickListener) { // rightBtn.setText(""); // rightBtn.setCompoundDrawablesWithIntrinsicBounds(ContextCompat.getDrawable(context, iconRes), null, null, null); // rightBtn.setOnClickListener(onClickListener); // } // // public AppCompatTextView getLeftBtn() { // return leftBtn; // } // // public AppCompatTextView getTvTitle() { // return tvTitle; // } // // public AppCompatTextView getRightBtn() { // return rightBtn; // } // }
import vn.eazy.base.mvp.toolbar.ToolbarHelper;
package vn.eazy.base.mvp.base; /** * Created by Harry on 12/23/16. */ public interface OnBaseActionListener { void setTitleToolbar(String msg); void setTitleToolbar(String msg, String font); void setTitleMainColor(int color); void showMenu(boolean isShow);
// Path: code/base/src/main/java/vn/eazy/base/mvp/toolbar/ToolbarHelper.java // public class ToolbarHelper implements OnToolbarAction { // protected Toolbar toolbar; // protected AppCompatTextView leftBtn; // protected AppCompatTextView tvTitle; // protected AppCompatTextView rightBtn; // protected Context context; // // public ToolbarHelper(Toolbar toolbar) throws IllegalAccessException { // this.toolbar = toolbar; // context = toolbar.getContext(); // leftBtn = (AppCompatTextView) toolbar.findViewById(R.id.left_button); // rightBtn = (AppCompatTextView) toolbar.findViewById(R.id.right_button); // if (rightBtn == null) { // throw new IllegalAccessException("Can't find this right button."); // } else { // rightBtn.setClickable(true); // } // if (leftBtn == null) { // throw new IllegalAccessException("Can't find this Left button"); // } else { // leftBtn.setClickable(true); // } // tvTitle = (AppCompatTextView) toolbar.findViewById(R.id.tvTitleToolbar); // if (tvTitle == null) { // throw new IllegalAccessException("Can't find this Title TextView"); // } else { // tvTitle.setClickable(true); // } // } // // @Override // public void setTitle(@NonNull String title) { // if (toolbar != null) // setTitle(title, ""); // } // // @Override // public void setTitle(@NonNull String title, @NonNull String font) { // tvTitle.setText(title); // if (!TextUtils.isEmpty(font)) { // tvTitle.setTypeface(Typeface.createFromAsset(tvTitle.getContext().getAssets(), font)); // } // } // // @Override // public void setTitleMainColor(int color) { // if (toolbar != null) // tvTitle.setTextColor(color); // } // // @Override // public void showToolbar(boolean isShow) { // if (toolbar != null) // if (isShow) { // toolbar.setVisibility(View.VISIBLE); // } else { // toolbar.setVisibility(View.GONE); // } // } // // @Override // public void showLeftButton(boolean isShow) { // showLeftButton(isShow, null); // } // // @Override // public void showLeftButton(boolean isShow, View.OnClickListener onClickListener) { // leftBtn.setVisibility(isShow ? View.VISIBLE : View.INVISIBLE); // if (onClickListener != null) { // leftBtn.setOnClickListener(onClickListener); // } // } // // @Override // public void showLeftButton(@Nullable int iconRes, View.OnClickListener onClickListener) { // leftBtn.setText(""); // leftBtn.setCompoundDrawablesWithIntrinsicBounds(ContextCompat.getDrawable(context, iconRes), null, null, null); // leftBtn.setOnClickListener(onClickListener); // showLeftButton(true); // } // // @Override // public void showLeftButton(@Nullable String text, View.OnClickListener onClickListener) { // leftBtn.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null); // leftBtn.setText(Html.fromHtml(text)); // leftBtn.setOnClickListener(onClickListener); // showLeftButton(true); // } // // // @Override // public void showRightButton(boolean isShow) { // rightBtn.setVisibility(isShow ? View.VISIBLE : View.INVISIBLE); // } // // @Override // public void showRightButton(@Nullable String text, View.OnClickListener onClickListener) { // rightBtn.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null); // rightBtn.setText(Html.fromHtml(text)); // rightBtn.setOnClickListener(onClickListener); // } // // @Override // public void showRightButton(@Nullable int iconRes, View.OnClickListener onClickListener) { // rightBtn.setText(""); // rightBtn.setCompoundDrawablesWithIntrinsicBounds(ContextCompat.getDrawable(context, iconRes), null, null, null); // rightBtn.setOnClickListener(onClickListener); // } // // public AppCompatTextView getLeftBtn() { // return leftBtn; // } // // public AppCompatTextView getTvTitle() { // return tvTitle; // } // // public AppCompatTextView getRightBtn() { // return rightBtn; // } // } // Path: code/base/src/main/java/vn/eazy/base/mvp/base/OnBaseActionListener.java import vn.eazy.base.mvp.toolbar.ToolbarHelper; package vn.eazy.base.mvp.base; /** * Created by Harry on 12/23/16. */ public interface OnBaseActionListener { void setTitleToolbar(String msg); void setTitleToolbar(String msg, String font); void setTitleMainColor(int color); void showMenu(boolean isShow);
ToolbarHelper getToolbarHelper() throws IllegalAccessException;
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/base/dialog/BaseDataDialog.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/architect/IModel.java // public interface IModel { // void onDestroy(); // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/helper/CommonHelper.java // public class CommonHelper { // public static int dpToPx(int dp, Context context) { // DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics(); // return Math.round(dp * (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT)); // } // // public static int pxToDp(int px, Context context) { // DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics(); // return Math.round(px / (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT)); // } // // public static int getScreenWidth() { // return Resources.getSystem().getDisplayMetrics().widthPixels; // } // // public static int getScreenHeight() { // return Resources.getSystem().getDisplayMetrics().heightPixels; // } // // }
import android.content.Context; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import java.util.List; import vn.eazy.base.mvp.R; import vn.eazy.base.mvp.architect.IModel; import vn.eazy.base.mvp.helper.CommonHelper;
} @Override public int getLayoutId() { return R.layout.layout_data_dialog; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); adapter = initAdapter(); llm = new LinearLayoutManager(getContext()); rvData.setLayoutManager(llm); rvData.setAdapter(adapter); } @Override public void setContentView(View view) { super.setContentView(view); bindViews(view); } @Override public void setContentView(View view, ViewGroup.LayoutParams params) { super.setContentView(view, params); bindViews(view); } private void bindViews(View rootView) { rvData = (RecyclerView) rootView.findViewById(R.id.rvData);
// Path: code/base/src/main/java/vn/eazy/base/mvp/architect/IModel.java // public interface IModel { // void onDestroy(); // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/helper/CommonHelper.java // public class CommonHelper { // public static int dpToPx(int dp, Context context) { // DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics(); // return Math.round(dp * (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT)); // } // // public static int pxToDp(int px, Context context) { // DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics(); // return Math.round(px / (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT)); // } // // public static int getScreenWidth() { // return Resources.getSystem().getDisplayMetrics().widthPixels; // } // // public static int getScreenHeight() { // return Resources.getSystem().getDisplayMetrics().heightPixels; // } // // } // Path: code/base/src/main/java/vn/eazy/base/mvp/base/dialog/BaseDataDialog.java import android.content.Context; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import java.util.List; import vn.eazy.base.mvp.R; import vn.eazy.base.mvp.architect.IModel; import vn.eazy.base.mvp.helper.CommonHelper; } @Override public int getLayoutId() { return R.layout.layout_data_dialog; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); adapter = initAdapter(); llm = new LinearLayoutManager(getContext()); rvData.setLayoutManager(llm); rvData.setAdapter(adapter); } @Override public void setContentView(View view) { super.setContentView(view); bindViews(view); } @Override public void setContentView(View view, ViewGroup.LayoutParams params) { super.setContentView(view, params); bindViews(view); } private void bindViews(View rootView) { rvData = (RecyclerView) rootView.findViewById(R.id.rvData);
rvData.getLayoutParams().width = widthDialog == -1 ? (int) (CommonHelper.getScreenWidth() * 0.6) : widthDialog;
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/architect/BasePresenter.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/RxErrorHandler.java // public class RxErrorHandler { // public final String TAG = this.getClass().getSimpleName(); // private ErrorHandlerFactory mHandlerFactory; // // public RxErrorHandler(Builder builder) { // this.mHandlerFactory = builder.errorHandlerFactory; // } // // // public static Builder builder() { // return new Builder(); // } // // public ErrorHandlerFactory getHandlerFactory() { // return mHandlerFactory; // } // // public static final class Builder { // private Context context; // private ResponseErrorListener mResponseErrorListener; // private ErrorHandlerFactory errorHandlerFactory; // // private Builder() { // } // // public Builder with(Context context) { // this.context = context; // return this; // } // // public Builder responseErrorListener(ResponseErrorListener responseErrorListener) { // this.mResponseErrorListener = responseErrorListener; // return this; // } // // public RxErrorHandler build() { // if (context == null) // throw new IllegalStateException("Context is required"); // // if (mResponseErrorListener == null) // throw new IllegalStateException("ResponseErrorListener is required"); // // this.errorHandlerFactory = new ErrorHandlerFactory(context, mResponseErrorListener); // // return new RxErrorHandler(this); // } // } // // }
import org.greenrobot.eventbus.EventBus; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.Disposable; import vn.eazy.base.mvp.intergration.handler.error.RxErrorHandler;
package vn.eazy.base.mvp.architect; /** * Created by harryle on 6/10/17. */ public class BasePresenter<M extends IModel, V extends IView> implements IPresenter { protected final String TAG = this.getClass().getSimpleName(); protected CompositeDisposable mCompositeDisposable; protected M mModel; protected V mView;
// Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/RxErrorHandler.java // public class RxErrorHandler { // public final String TAG = this.getClass().getSimpleName(); // private ErrorHandlerFactory mHandlerFactory; // // public RxErrorHandler(Builder builder) { // this.mHandlerFactory = builder.errorHandlerFactory; // } // // // public static Builder builder() { // return new Builder(); // } // // public ErrorHandlerFactory getHandlerFactory() { // return mHandlerFactory; // } // // public static final class Builder { // private Context context; // private ResponseErrorListener mResponseErrorListener; // private ErrorHandlerFactory errorHandlerFactory; // // private Builder() { // } // // public Builder with(Context context) { // this.context = context; // return this; // } // // public Builder responseErrorListener(ResponseErrorListener responseErrorListener) { // this.mResponseErrorListener = responseErrorListener; // return this; // } // // public RxErrorHandler build() { // if (context == null) // throw new IllegalStateException("Context is required"); // // if (mResponseErrorListener == null) // throw new IllegalStateException("ResponseErrorListener is required"); // // this.errorHandlerFactory = new ErrorHandlerFactory(context, mResponseErrorListener); // // return new RxErrorHandler(this); // } // } // // } // Path: code/base/src/main/java/vn/eazy/base/mvp/architect/BasePresenter.java import org.greenrobot.eventbus.EventBus; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.Disposable; import vn.eazy.base.mvp.intergration.handler.error.RxErrorHandler; package vn.eazy.base.mvp.architect; /** * Created by harryle on 6/10/17. */ public class BasePresenter<M extends IModel, V extends IView> implements IPresenter { protected final String TAG = this.getClass().getSimpleName(); protected CompositeDisposable mCompositeDisposable; protected M mModel; protected V mView;
protected RxErrorHandler mHandler;
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/base/application/BaseApplication.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/App.java // public interface App { // AppComponent getAppComponent(); // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/AppDelegate.java // public class AppDelegate implements App { // private Application mApplication; // private AppComponent mAppComponent; // // @Inject // ActivityLifeCycle mActivityLifeCycle; // // private final List<ConfigModule> mConfigModules; // private List<LifeCycle> mAppLifeCycles = new ArrayList<>(); // private List<Application.ActivityLifecycleCallbacks> mActivityLifeCycles = new ArrayList<>(); // // public AppDelegate(Application application) { // this.mApplication = application; // this.mConfigModules = new ManifestParser(application).parse(); // for (ConfigModule module : mConfigModules) { // module.injectAppLifeCycles(mApplication, mAppLifeCycles); // module.injectActivityLifeCycles(mApplication, mActivityLifeCycles); // } // } // // public void onCreate() { // mAppComponent = DaggerAppComponent.builder() // .appModule(new AppModule(mApplication)) // .clientModule(new ClientModule()) // .globalModule(getGlobalModule(mApplication, mConfigModules)) // .build(); // // mAppComponent.inject(this); // // mAppComponent.extras().put(ConfigModule.class.getSimpleName(), mConfigModules); // // for (ConfigModule module : mConfigModules) { // module.registerComponents(mApplication, mAppComponent.getIRepositoryManager()); // } // // mApplication.registerActivityLifecycleCallbacks(mActivityLifeCycle); // // for (Application.ActivityLifecycleCallbacks activityLifecycleCallbacks : mActivityLifeCycles) { // mApplication.registerActivityLifecycleCallbacks(activityLifecycleCallbacks); // } // // for (LifeCycle lifeCycle : mAppLifeCycles) { // lifeCycle.onCreate(mApplication); // } // // } // // public void onTerminal() { // if (mAppLifeCycles != null) { // for (LifeCycle lifeCycle : mAppLifeCycles) { // lifeCycle.onTerminate(mApplication); // } // } // // if (mActivityLifeCycle != null) { // mApplication.unregisterActivityLifecycleCallbacks(mActivityLifeCycle); // } // // if (mActivityLifeCycles != null && !mActivityLifeCycles.isEmpty()) { // for (Application.ActivityLifecycleCallbacks activityLifecycleCallbacks : mActivityLifeCycles) { // mApplication.unregisterActivityLifecycleCallbacks(activityLifecycleCallbacks); // } // } // // this.mAppLifeCycles = null; // this.mActivityLifeCycle = null; // this.mActivityLifeCycles = null; // this.mAppComponent = null; // this.mApplication = null; // // // } // // public AppComponent getAppComponent() { // return mAppComponent; // } // // public interface LifeCycle { // void onCreate(Application application); // // void onTerminate(Application application); // } // // private GlobalModule getGlobalModule(Application context, List<ConfigModule> modules) { // GlobalModule.Builder builder = GlobalModule // .builder(); // // for (ConfigModule module : modules) { // module.applyOptions(context, builder); // } // return builder.build(); // } // // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/di/component/AppComponent.java // @Singleton // @Component(modules = {AppModule.class, ClientModule.class, GlobalModule.class}) // public interface AppComponent { // Application application(); // // OkHttpClient okHttpClient(); // // Gson gson(); // // File cacheFile(); // // Map<String, Object> extras(); // // IRepositoryManager getIRepositoryManager(); // // RxErrorHandler rxErrorHandler(); // // Retrofit retrofit(); // // HttpUrl httpUrl(); // // void inject(AppDelegate appDelegate); // }
import android.app.Application; import android.content.Context; import vn.eazy.base.mvp.delegate.App; import vn.eazy.base.mvp.delegate.AppDelegate; import vn.eazy.base.mvp.di.component.AppComponent;
package vn.eazy.base.mvp.base.application; /** * Created by harryle on 6/17/17. */ public class BaseApplication extends Application implements App { private AppDelegate mAppDelegate; @Override public void onCreate() { super.onCreate(); this.mAppDelegate = new AppDelegate(this); this.mAppDelegate.onCreate(); } @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); // MultiDex.install(this); } @Override public void onTerminate() { super.onTerminate(); if (mAppDelegate != null) { mAppDelegate.onTerminal(); } } @Override
// Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/App.java // public interface App { // AppComponent getAppComponent(); // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/AppDelegate.java // public class AppDelegate implements App { // private Application mApplication; // private AppComponent mAppComponent; // // @Inject // ActivityLifeCycle mActivityLifeCycle; // // private final List<ConfigModule> mConfigModules; // private List<LifeCycle> mAppLifeCycles = new ArrayList<>(); // private List<Application.ActivityLifecycleCallbacks> mActivityLifeCycles = new ArrayList<>(); // // public AppDelegate(Application application) { // this.mApplication = application; // this.mConfigModules = new ManifestParser(application).parse(); // for (ConfigModule module : mConfigModules) { // module.injectAppLifeCycles(mApplication, mAppLifeCycles); // module.injectActivityLifeCycles(mApplication, mActivityLifeCycles); // } // } // // public void onCreate() { // mAppComponent = DaggerAppComponent.builder() // .appModule(new AppModule(mApplication)) // .clientModule(new ClientModule()) // .globalModule(getGlobalModule(mApplication, mConfigModules)) // .build(); // // mAppComponent.inject(this); // // mAppComponent.extras().put(ConfigModule.class.getSimpleName(), mConfigModules); // // for (ConfigModule module : mConfigModules) { // module.registerComponents(mApplication, mAppComponent.getIRepositoryManager()); // } // // mApplication.registerActivityLifecycleCallbacks(mActivityLifeCycle); // // for (Application.ActivityLifecycleCallbacks activityLifecycleCallbacks : mActivityLifeCycles) { // mApplication.registerActivityLifecycleCallbacks(activityLifecycleCallbacks); // } // // for (LifeCycle lifeCycle : mAppLifeCycles) { // lifeCycle.onCreate(mApplication); // } // // } // // public void onTerminal() { // if (mAppLifeCycles != null) { // for (LifeCycle lifeCycle : mAppLifeCycles) { // lifeCycle.onTerminate(mApplication); // } // } // // if (mActivityLifeCycle != null) { // mApplication.unregisterActivityLifecycleCallbacks(mActivityLifeCycle); // } // // if (mActivityLifeCycles != null && !mActivityLifeCycles.isEmpty()) { // for (Application.ActivityLifecycleCallbacks activityLifecycleCallbacks : mActivityLifeCycles) { // mApplication.unregisterActivityLifecycleCallbacks(activityLifecycleCallbacks); // } // } // // this.mAppLifeCycles = null; // this.mActivityLifeCycle = null; // this.mActivityLifeCycles = null; // this.mAppComponent = null; // this.mApplication = null; // // // } // // public AppComponent getAppComponent() { // return mAppComponent; // } // // public interface LifeCycle { // void onCreate(Application application); // // void onTerminate(Application application); // } // // private GlobalModule getGlobalModule(Application context, List<ConfigModule> modules) { // GlobalModule.Builder builder = GlobalModule // .builder(); // // for (ConfigModule module : modules) { // module.applyOptions(context, builder); // } // return builder.build(); // } // // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/di/component/AppComponent.java // @Singleton // @Component(modules = {AppModule.class, ClientModule.class, GlobalModule.class}) // public interface AppComponent { // Application application(); // // OkHttpClient okHttpClient(); // // Gson gson(); // // File cacheFile(); // // Map<String, Object> extras(); // // IRepositoryManager getIRepositoryManager(); // // RxErrorHandler rxErrorHandler(); // // Retrofit retrofit(); // // HttpUrl httpUrl(); // // void inject(AppDelegate appDelegate); // } // Path: code/base/src/main/java/vn/eazy/base/mvp/base/application/BaseApplication.java import android.app.Application; import android.content.Context; import vn.eazy.base.mvp.delegate.App; import vn.eazy.base.mvp.delegate.AppDelegate; import vn.eazy.base.mvp.di.component.AppComponent; package vn.eazy.base.mvp.base.application; /** * Created by harryle on 6/17/17. */ public class BaseApplication extends Application implements App { private AppDelegate mAppDelegate; @Override public void onCreate() { super.onCreate(); this.mAppDelegate = new AppDelegate(this); this.mAppDelegate.onCreate(); } @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); // MultiDex.install(this); } @Override public void onTerminate() { super.onTerminate(); if (mAppDelegate != null) { mAppDelegate.onTerminal(); } } @Override
public AppComponent getAppComponent() {
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/intergration/RepositoryManager.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/utils/PreConditions.java // public final class PreConditions { // private PreConditions() { // } // // public static void checkArgument(boolean expression) { // if (!expression) { // throw new IllegalArgumentException(); // } // } // // public static void checkArgument(boolean expression, @Nullable Object errorMessage) { // if (!expression) { // throw new IllegalArgumentException(String.valueOf(errorMessage)); // } // } // // public static void checkState(boolean expression) { // if (!expression) { // throw new IllegalStateException(); // } // } // // public static void checkState(boolean expression, @Nullable Object errorMessage) { // if (!expression) { // throw new IllegalStateException(String.valueOf(errorMessage)); // } // } // // public static <T> T checkNotNull(T reference) { // if (reference != null) { // return reference; // } else { // throw new NullPointerException(); // } // } // // public static <T> T checkNotNull(T reference, @Nullable Object errorMessage) { // if (reference != null) { // return reference; // } else { // throw new NullPointerException(String.valueOf(errorMessage)); // } // } // // // }
import java.util.LinkedHashMap; import java.util.Map; import javax.inject.Inject; import javax.inject.Singleton; import dagger.internal.Preconditions; import retrofit2.Retrofit; import vn.eazy.base.mvp.utils.PreConditions;
package vn.eazy.base.mvp.intergration; /** * Created by harryle on 6/17/17. */ @Singleton public class RepositoryManager implements IRepositoryManager { private Retrofit mRetrofit; private final Map<String, Object> mRetrofitServiceCache = new LinkedHashMap<>(); @Inject public RepositoryManager(Retrofit retrofit) { this.mRetrofit = retrofit; } @Override public void injectRetrofitService(Class<?>... services) { for (Class<?> service : services) { if (!mRetrofitServiceCache.containsKey(service.getSimpleName())) { mRetrofitServiceCache.put(service.getSimpleName(), mRetrofit.create(service)); } } } @Override public <T> T obtainRetrofitServices(Class<T> service) {
// Path: code/base/src/main/java/vn/eazy/base/mvp/utils/PreConditions.java // public final class PreConditions { // private PreConditions() { // } // // public static void checkArgument(boolean expression) { // if (!expression) { // throw new IllegalArgumentException(); // } // } // // public static void checkArgument(boolean expression, @Nullable Object errorMessage) { // if (!expression) { // throw new IllegalArgumentException(String.valueOf(errorMessage)); // } // } // // public static void checkState(boolean expression) { // if (!expression) { // throw new IllegalStateException(); // } // } // // public static void checkState(boolean expression, @Nullable Object errorMessage) { // if (!expression) { // throw new IllegalStateException(String.valueOf(errorMessage)); // } // } // // public static <T> T checkNotNull(T reference) { // if (reference != null) { // return reference; // } else { // throw new NullPointerException(); // } // } // // public static <T> T checkNotNull(T reference, @Nullable Object errorMessage) { // if (reference != null) { // return reference; // } else { // throw new NullPointerException(String.valueOf(errorMessage)); // } // } // // // } // Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/RepositoryManager.java import java.util.LinkedHashMap; import java.util.Map; import javax.inject.Inject; import javax.inject.Singleton; import dagger.internal.Preconditions; import retrofit2.Retrofit; import vn.eazy.base.mvp.utils.PreConditions; package vn.eazy.base.mvp.intergration; /** * Created by harryle on 6/17/17. */ @Singleton public class RepositoryManager implements IRepositoryManager { private Retrofit mRetrofit; private final Map<String, Object> mRetrofitServiceCache = new LinkedHashMap<>(); @Inject public RepositoryManager(Retrofit retrofit) { this.mRetrofit = retrofit; } @Override public void injectRetrofitService(Class<?>... services) { for (Class<?> service : services) { if (!mRetrofitServiceCache.containsKey(service.getSimpleName())) { mRetrofitServiceCache.put(service.getSimpleName(), mRetrofit.create(service)); } } } @Override public <T> T obtainRetrofitServices(Class<T> service) {
PreConditions.checkState(mRetrofitServiceCache.containsKey(service.getSimpleName()),
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/intergration/FragmentLifeCycle.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/FragmentDelegate.java // public class FragmentDelegate implements Fragment,Serializable { // public static final String FRAGMENT_LIFECYCLE = "fragment_lifecycle"; // private IFragment iFragment; // private android.support.v4.app.Fragment mFragment; // // public FragmentDelegate(android.support.v4.app.Fragment fragment) { // this.iFragment = (IFragment) fragment; // this.mFragment = fragment; // } // // @Override // public void onCreate(Bundle savedInstanceState) { // if (iFragment.useEventBus()) { // EventBus.getDefault().register(mFragment); // } // iFragment.setupFragmentComponent(((App) mFragment.getActivity().getApplicationContext()).getAppComponent()); // } // // @Override // public void onDestroy() { // if (iFragment.useEventBus()) { // EventBus.getDefault().unregister(mFragment); // } // this.mFragment = null; // this.iFragment = null; // } // // @Override // public void onDestroyView() { // // } // // @Override // public void onResume() { // // } // // @Override // public void onPause() { // // } // // @Override // public void onActivityCreated(Bundle savedInstanceState) { // iFragment.initData(savedInstanceState); // } // // @Override // public void onDetach() { // // } // // @Override // public void onAttach(Context context) { // // } // // @Override // public void onStart() { // // } // // @Override // public void onCreateView(View view, Bundle savedInstanceState) { // } // // @Override // public void onSaveInstanceState(Bundle outState) { // // } // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/IFragment.java // public interface IFragment { // /** // * // * @param appComponent // */ // void setupFragmentComponent(AppComponent appComponent); // // /** // * // * @return // */ // boolean useEventBus(); // // /** // * // * @param savedInstanceState // */ // void initData(Bundle savedInstanceState); // // }
import android.content.Context; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.util.Log; import vn.eazy.base.mvp.delegate.FragmentDelegate; import vn.eazy.base.mvp.delegate.IFragment;
package vn.eazy.base.mvp.intergration; /** * Created by harryle on 6/20/17. */ public class FragmentLifeCycle extends FragmentManager.FragmentLifecycleCallbacks { @Override public void onFragmentCreated(FragmentManager fm, Fragment f, Bundle savedInstanceState) { super.onFragmentCreated(fm, f, savedInstanceState);
// Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/FragmentDelegate.java // public class FragmentDelegate implements Fragment,Serializable { // public static final String FRAGMENT_LIFECYCLE = "fragment_lifecycle"; // private IFragment iFragment; // private android.support.v4.app.Fragment mFragment; // // public FragmentDelegate(android.support.v4.app.Fragment fragment) { // this.iFragment = (IFragment) fragment; // this.mFragment = fragment; // } // // @Override // public void onCreate(Bundle savedInstanceState) { // if (iFragment.useEventBus()) { // EventBus.getDefault().register(mFragment); // } // iFragment.setupFragmentComponent(((App) mFragment.getActivity().getApplicationContext()).getAppComponent()); // } // // @Override // public void onDestroy() { // if (iFragment.useEventBus()) { // EventBus.getDefault().unregister(mFragment); // } // this.mFragment = null; // this.iFragment = null; // } // // @Override // public void onDestroyView() { // // } // // @Override // public void onResume() { // // } // // @Override // public void onPause() { // // } // // @Override // public void onActivityCreated(Bundle savedInstanceState) { // iFragment.initData(savedInstanceState); // } // // @Override // public void onDetach() { // // } // // @Override // public void onAttach(Context context) { // // } // // @Override // public void onStart() { // // } // // @Override // public void onCreateView(View view, Bundle savedInstanceState) { // } // // @Override // public void onSaveInstanceState(Bundle outState) { // // } // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/IFragment.java // public interface IFragment { // /** // * // * @param appComponent // */ // void setupFragmentComponent(AppComponent appComponent); // // /** // * // * @return // */ // boolean useEventBus(); // // /** // * // * @param savedInstanceState // */ // void initData(Bundle savedInstanceState); // // } // Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/FragmentLifeCycle.java import android.content.Context; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.util.Log; import vn.eazy.base.mvp.delegate.FragmentDelegate; import vn.eazy.base.mvp.delegate.IFragment; package vn.eazy.base.mvp.intergration; /** * Created by harryle on 6/20/17. */ public class FragmentLifeCycle extends FragmentManager.FragmentLifecycleCallbacks { @Override public void onFragmentCreated(FragmentManager fm, Fragment f, Bundle savedInstanceState) { super.onFragmentCreated(fm, f, savedInstanceState);
FragmentDelegate delegate = getFragmentDelegate(f);
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/intergration/FragmentLifeCycle.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/FragmentDelegate.java // public class FragmentDelegate implements Fragment,Serializable { // public static final String FRAGMENT_LIFECYCLE = "fragment_lifecycle"; // private IFragment iFragment; // private android.support.v4.app.Fragment mFragment; // // public FragmentDelegate(android.support.v4.app.Fragment fragment) { // this.iFragment = (IFragment) fragment; // this.mFragment = fragment; // } // // @Override // public void onCreate(Bundle savedInstanceState) { // if (iFragment.useEventBus()) { // EventBus.getDefault().register(mFragment); // } // iFragment.setupFragmentComponent(((App) mFragment.getActivity().getApplicationContext()).getAppComponent()); // } // // @Override // public void onDestroy() { // if (iFragment.useEventBus()) { // EventBus.getDefault().unregister(mFragment); // } // this.mFragment = null; // this.iFragment = null; // } // // @Override // public void onDestroyView() { // // } // // @Override // public void onResume() { // // } // // @Override // public void onPause() { // // } // // @Override // public void onActivityCreated(Bundle savedInstanceState) { // iFragment.initData(savedInstanceState); // } // // @Override // public void onDetach() { // // } // // @Override // public void onAttach(Context context) { // // } // // @Override // public void onStart() { // // } // // @Override // public void onCreateView(View view, Bundle savedInstanceState) { // } // // @Override // public void onSaveInstanceState(Bundle outState) { // // } // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/IFragment.java // public interface IFragment { // /** // * // * @param appComponent // */ // void setupFragmentComponent(AppComponent appComponent); // // /** // * // * @return // */ // boolean useEventBus(); // // /** // * // * @param savedInstanceState // */ // void initData(Bundle savedInstanceState); // // }
import android.content.Context; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.util.Log; import vn.eazy.base.mvp.delegate.FragmentDelegate; import vn.eazy.base.mvp.delegate.IFragment;
package vn.eazy.base.mvp.intergration; /** * Created by harryle on 6/20/17. */ public class FragmentLifeCycle extends FragmentManager.FragmentLifecycleCallbacks { @Override public void onFragmentCreated(FragmentManager fm, Fragment f, Bundle savedInstanceState) { super.onFragmentCreated(fm, f, savedInstanceState); FragmentDelegate delegate = getFragmentDelegate(f); if (delegate != null) { delegate.onCreate(savedInstanceState); } Log.d("TAG", "onFragmentCreated life cycle"); } @Override public void onFragmentActivityCreated(FragmentManager fm, Fragment f, Bundle savedInstanceState) { super.onFragmentActivityCreated(fm, f, savedInstanceState); FragmentDelegate delegate = getFragmentDelegate(f); if (delegate != null) { delegate.onActivityCreated(savedInstanceState); } } @Override public void onFragmentAttached(FragmentManager fm, Fragment f, Context context) { super.onFragmentAttached(fm, f, context);
// Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/FragmentDelegate.java // public class FragmentDelegate implements Fragment,Serializable { // public static final String FRAGMENT_LIFECYCLE = "fragment_lifecycle"; // private IFragment iFragment; // private android.support.v4.app.Fragment mFragment; // // public FragmentDelegate(android.support.v4.app.Fragment fragment) { // this.iFragment = (IFragment) fragment; // this.mFragment = fragment; // } // // @Override // public void onCreate(Bundle savedInstanceState) { // if (iFragment.useEventBus()) { // EventBus.getDefault().register(mFragment); // } // iFragment.setupFragmentComponent(((App) mFragment.getActivity().getApplicationContext()).getAppComponent()); // } // // @Override // public void onDestroy() { // if (iFragment.useEventBus()) { // EventBus.getDefault().unregister(mFragment); // } // this.mFragment = null; // this.iFragment = null; // } // // @Override // public void onDestroyView() { // // } // // @Override // public void onResume() { // // } // // @Override // public void onPause() { // // } // // @Override // public void onActivityCreated(Bundle savedInstanceState) { // iFragment.initData(savedInstanceState); // } // // @Override // public void onDetach() { // // } // // @Override // public void onAttach(Context context) { // // } // // @Override // public void onStart() { // // } // // @Override // public void onCreateView(View view, Bundle savedInstanceState) { // } // // @Override // public void onSaveInstanceState(Bundle outState) { // // } // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/delegate/IFragment.java // public interface IFragment { // /** // * // * @param appComponent // */ // void setupFragmentComponent(AppComponent appComponent); // // /** // * // * @return // */ // boolean useEventBus(); // // /** // * // * @param savedInstanceState // */ // void initData(Bundle savedInstanceState); // // } // Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/FragmentLifeCycle.java import android.content.Context; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.util.Log; import vn.eazy.base.mvp.delegate.FragmentDelegate; import vn.eazy.base.mvp.delegate.IFragment; package vn.eazy.base.mvp.intergration; /** * Created by harryle on 6/20/17. */ public class FragmentLifeCycle extends FragmentManager.FragmentLifecycleCallbacks { @Override public void onFragmentCreated(FragmentManager fm, Fragment f, Bundle savedInstanceState) { super.onFragmentCreated(fm, f, savedInstanceState); FragmentDelegate delegate = getFragmentDelegate(f); if (delegate != null) { delegate.onCreate(savedInstanceState); } Log.d("TAG", "onFragmentCreated life cycle"); } @Override public void onFragmentActivityCreated(FragmentManager fm, Fragment f, Bundle savedInstanceState) { super.onFragmentActivityCreated(fm, f, savedInstanceState); FragmentDelegate delegate = getFragmentDelegate(f); if (delegate != null) { delegate.onActivityCreated(savedInstanceState); } } @Override public void onFragmentAttached(FragmentManager fm, Fragment f, Context context) { super.onFragmentAttached(fm, f, context);
if (f instanceof IFragment && f.getArguments() != null) {
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/di/module/ClientModule.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/RxErrorHandler.java // public class RxErrorHandler { // public final String TAG = this.getClass().getSimpleName(); // private ErrorHandlerFactory mHandlerFactory; // // public RxErrorHandler(Builder builder) { // this.mHandlerFactory = builder.errorHandlerFactory; // } // // // public static Builder builder() { // return new Builder(); // } // // public ErrorHandlerFactory getHandlerFactory() { // return mHandlerFactory; // } // // public static final class Builder { // private Context context; // private ResponseErrorListener mResponseErrorListener; // private ErrorHandlerFactory errorHandlerFactory; // // private Builder() { // } // // public Builder with(Context context) { // this.context = context; // return this; // } // // public Builder responseErrorListener(ResponseErrorListener responseErrorListener) { // this.mResponseErrorListener = responseErrorListener; // return this; // } // // public RxErrorHandler build() { // if (context == null) // throw new IllegalStateException("Context is required"); // // if (mResponseErrorListener == null) // throw new IllegalStateException("ResponseErrorListener is required"); // // this.errorHandlerFactory = new ErrorHandlerFactory(context, mResponseErrorListener); // // return new RxErrorHandler(this); // } // } // // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/listener/ResponseErrorListener.java // public interface ResponseErrorListener { // void handleResponseError(Context context, Throwable t); // // ResponseErrorListener EMPTY = new ResponseErrorListener() { // @Override // public void handleResponseError(Context context, Throwable t) { // // } // }; // }
import android.app.Application; import android.content.Context; import android.support.annotation.Nullable; import com.ihsanbal.logging.Level; import com.ihsanbal.logging.LoggingInterceptor; import java.io.File; import java.util.List; import java.util.concurrent.TimeUnit; import javax.inject.Singleton; import dagger.Module; import dagger.Provides; import okhttp3.Cache; import okhttp3.HttpUrl; import okhttp3.Interceptor; import okhttp3.OkHttpClient; import retrofit2.Retrofit; import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import retrofit2.converter.gson.GsonConverterFactory; import vn.eazy.base.mvp.BuildConfig; import vn.eazy.base.mvp.intergration.handler.error.RxErrorHandler; import vn.eazy.base.mvp.intergration.handler.error.listener.ResponseErrorListener;
if (httpConfiguration != null) { httpConfiguration.configOkHttp(application, builder); } return builder.build(); } @Provides @Singleton public Retrofit.Builder provideRetrofitBuilder() { return new Retrofit.Builder(); } @Provides @Singleton public Retrofit provideRetrofit(Application application, OkHttpClient okHttpClient, Retrofit.Builder builder, HttpUrl httpUrl, @Nullable RetrofitConfiguration configuration) { builder.baseUrl(httpUrl) .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .addConverterFactory(GsonConverterFactory.create()) .client(okHttpClient); if (configuration != null) { configuration.configRetrofit(application, builder); } return builder.build(); } @Provides @Singleton
// Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/RxErrorHandler.java // public class RxErrorHandler { // public final String TAG = this.getClass().getSimpleName(); // private ErrorHandlerFactory mHandlerFactory; // // public RxErrorHandler(Builder builder) { // this.mHandlerFactory = builder.errorHandlerFactory; // } // // // public static Builder builder() { // return new Builder(); // } // // public ErrorHandlerFactory getHandlerFactory() { // return mHandlerFactory; // } // // public static final class Builder { // private Context context; // private ResponseErrorListener mResponseErrorListener; // private ErrorHandlerFactory errorHandlerFactory; // // private Builder() { // } // // public Builder with(Context context) { // this.context = context; // return this; // } // // public Builder responseErrorListener(ResponseErrorListener responseErrorListener) { // this.mResponseErrorListener = responseErrorListener; // return this; // } // // public RxErrorHandler build() { // if (context == null) // throw new IllegalStateException("Context is required"); // // if (mResponseErrorListener == null) // throw new IllegalStateException("ResponseErrorListener is required"); // // this.errorHandlerFactory = new ErrorHandlerFactory(context, mResponseErrorListener); // // return new RxErrorHandler(this); // } // } // // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/listener/ResponseErrorListener.java // public interface ResponseErrorListener { // void handleResponseError(Context context, Throwable t); // // ResponseErrorListener EMPTY = new ResponseErrorListener() { // @Override // public void handleResponseError(Context context, Throwable t) { // // } // }; // } // Path: code/base/src/main/java/vn/eazy/base/mvp/di/module/ClientModule.java import android.app.Application; import android.content.Context; import android.support.annotation.Nullable; import com.ihsanbal.logging.Level; import com.ihsanbal.logging.LoggingInterceptor; import java.io.File; import java.util.List; import java.util.concurrent.TimeUnit; import javax.inject.Singleton; import dagger.Module; import dagger.Provides; import okhttp3.Cache; import okhttp3.HttpUrl; import okhttp3.Interceptor; import okhttp3.OkHttpClient; import retrofit2.Retrofit; import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import retrofit2.converter.gson.GsonConverterFactory; import vn.eazy.base.mvp.BuildConfig; import vn.eazy.base.mvp.intergration.handler.error.RxErrorHandler; import vn.eazy.base.mvp.intergration.handler.error.listener.ResponseErrorListener; if (httpConfiguration != null) { httpConfiguration.configOkHttp(application, builder); } return builder.build(); } @Provides @Singleton public Retrofit.Builder provideRetrofitBuilder() { return new Retrofit.Builder(); } @Provides @Singleton public Retrofit provideRetrofit(Application application, OkHttpClient okHttpClient, Retrofit.Builder builder, HttpUrl httpUrl, @Nullable RetrofitConfiguration configuration) { builder.baseUrl(httpUrl) .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .addConverterFactory(GsonConverterFactory.create()) .client(okHttpClient); if (configuration != null) { configuration.configRetrofit(application, builder); } return builder.build(); } @Provides @Singleton
public RxErrorHandler provideErrorHandler(Application application, ResponseErrorListener errorListener) {
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/di/module/ClientModule.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/RxErrorHandler.java // public class RxErrorHandler { // public final String TAG = this.getClass().getSimpleName(); // private ErrorHandlerFactory mHandlerFactory; // // public RxErrorHandler(Builder builder) { // this.mHandlerFactory = builder.errorHandlerFactory; // } // // // public static Builder builder() { // return new Builder(); // } // // public ErrorHandlerFactory getHandlerFactory() { // return mHandlerFactory; // } // // public static final class Builder { // private Context context; // private ResponseErrorListener mResponseErrorListener; // private ErrorHandlerFactory errorHandlerFactory; // // private Builder() { // } // // public Builder with(Context context) { // this.context = context; // return this; // } // // public Builder responseErrorListener(ResponseErrorListener responseErrorListener) { // this.mResponseErrorListener = responseErrorListener; // return this; // } // // public RxErrorHandler build() { // if (context == null) // throw new IllegalStateException("Context is required"); // // if (mResponseErrorListener == null) // throw new IllegalStateException("ResponseErrorListener is required"); // // this.errorHandlerFactory = new ErrorHandlerFactory(context, mResponseErrorListener); // // return new RxErrorHandler(this); // } // } // // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/listener/ResponseErrorListener.java // public interface ResponseErrorListener { // void handleResponseError(Context context, Throwable t); // // ResponseErrorListener EMPTY = new ResponseErrorListener() { // @Override // public void handleResponseError(Context context, Throwable t) { // // } // }; // }
import android.app.Application; import android.content.Context; import android.support.annotation.Nullable; import com.ihsanbal.logging.Level; import com.ihsanbal.logging.LoggingInterceptor; import java.io.File; import java.util.List; import java.util.concurrent.TimeUnit; import javax.inject.Singleton; import dagger.Module; import dagger.Provides; import okhttp3.Cache; import okhttp3.HttpUrl; import okhttp3.Interceptor; import okhttp3.OkHttpClient; import retrofit2.Retrofit; import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import retrofit2.converter.gson.GsonConverterFactory; import vn.eazy.base.mvp.BuildConfig; import vn.eazy.base.mvp.intergration.handler.error.RxErrorHandler; import vn.eazy.base.mvp.intergration.handler.error.listener.ResponseErrorListener;
if (httpConfiguration != null) { httpConfiguration.configOkHttp(application, builder); } return builder.build(); } @Provides @Singleton public Retrofit.Builder provideRetrofitBuilder() { return new Retrofit.Builder(); } @Provides @Singleton public Retrofit provideRetrofit(Application application, OkHttpClient okHttpClient, Retrofit.Builder builder, HttpUrl httpUrl, @Nullable RetrofitConfiguration configuration) { builder.baseUrl(httpUrl) .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .addConverterFactory(GsonConverterFactory.create()) .client(okHttpClient); if (configuration != null) { configuration.configRetrofit(application, builder); } return builder.build(); } @Provides @Singleton
// Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/RxErrorHandler.java // public class RxErrorHandler { // public final String TAG = this.getClass().getSimpleName(); // private ErrorHandlerFactory mHandlerFactory; // // public RxErrorHandler(Builder builder) { // this.mHandlerFactory = builder.errorHandlerFactory; // } // // // public static Builder builder() { // return new Builder(); // } // // public ErrorHandlerFactory getHandlerFactory() { // return mHandlerFactory; // } // // public static final class Builder { // private Context context; // private ResponseErrorListener mResponseErrorListener; // private ErrorHandlerFactory errorHandlerFactory; // // private Builder() { // } // // public Builder with(Context context) { // this.context = context; // return this; // } // // public Builder responseErrorListener(ResponseErrorListener responseErrorListener) { // this.mResponseErrorListener = responseErrorListener; // return this; // } // // public RxErrorHandler build() { // if (context == null) // throw new IllegalStateException("Context is required"); // // if (mResponseErrorListener == null) // throw new IllegalStateException("ResponseErrorListener is required"); // // this.errorHandlerFactory = new ErrorHandlerFactory(context, mResponseErrorListener); // // return new RxErrorHandler(this); // } // } // // } // // Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/listener/ResponseErrorListener.java // public interface ResponseErrorListener { // void handleResponseError(Context context, Throwable t); // // ResponseErrorListener EMPTY = new ResponseErrorListener() { // @Override // public void handleResponseError(Context context, Throwable t) { // // } // }; // } // Path: code/base/src/main/java/vn/eazy/base/mvp/di/module/ClientModule.java import android.app.Application; import android.content.Context; import android.support.annotation.Nullable; import com.ihsanbal.logging.Level; import com.ihsanbal.logging.LoggingInterceptor; import java.io.File; import java.util.List; import java.util.concurrent.TimeUnit; import javax.inject.Singleton; import dagger.Module; import dagger.Provides; import okhttp3.Cache; import okhttp3.HttpUrl; import okhttp3.Interceptor; import okhttp3.OkHttpClient; import retrofit2.Retrofit; import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import retrofit2.converter.gson.GsonConverterFactory; import vn.eazy.base.mvp.BuildConfig; import vn.eazy.base.mvp.intergration.handler.error.RxErrorHandler; import vn.eazy.base.mvp.intergration.handler.error.listener.ResponseErrorListener; if (httpConfiguration != null) { httpConfiguration.configOkHttp(application, builder); } return builder.build(); } @Provides @Singleton public Retrofit.Builder provideRetrofitBuilder() { return new Retrofit.Builder(); } @Provides @Singleton public Retrofit provideRetrofit(Application application, OkHttpClient okHttpClient, Retrofit.Builder builder, HttpUrl httpUrl, @Nullable RetrofitConfiguration configuration) { builder.baseUrl(httpUrl) .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .addConverterFactory(GsonConverterFactory.create()) .client(okHttpClient); if (configuration != null) { configuration.configRetrofit(application, builder); } return builder.build(); } @Provides @Singleton
public RxErrorHandler provideErrorHandler(Application application, ResponseErrorListener errorListener) {
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/ErrorHandlerFactory.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/listener/ResponseErrorListener.java // public interface ResponseErrorListener { // void handleResponseError(Context context, Throwable t); // // ResponseErrorListener EMPTY = new ResponseErrorListener() { // @Override // public void handleResponseError(Context context, Throwable t) { // // } // }; // }
import android.content.Context; import vn.eazy.base.mvp.intergration.handler.error.listener.ResponseErrorListener;
package vn.eazy.base.mvp.intergration.handler.error; /** * Created by harryle on 6/23/17. */ public class ErrorHandlerFactory { public final String TAG = this.getClass().getSimpleName(); private Context mContext;
// Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/listener/ResponseErrorListener.java // public interface ResponseErrorListener { // void handleResponseError(Context context, Throwable t); // // ResponseErrorListener EMPTY = new ResponseErrorListener() { // @Override // public void handleResponseError(Context context, Throwable t) { // // } // }; // } // Path: code/base/src/main/java/vn/eazy/base/mvp/intergration/handler/error/ErrorHandlerFactory.java import android.content.Context; import vn.eazy.base.mvp.intergration.handler.error.listener.ResponseErrorListener; package vn.eazy.base.mvp.intergration.handler.error; /** * Created by harryle on 6/23/17. */ public class ErrorHandlerFactory { public final String TAG = this.getClass().getSimpleName(); private Context mContext;
private ResponseErrorListener mResponseErrorListener;
harrylefit/EazyBaseMVP
code/base/src/main/java/vn/eazy/base/mvp/helper/FragmentStateHelper.java
// Path: code/base/src/main/java/vn/eazy/base/mvp/base/fragment/BaseFragment.java // public abstract class BaseFragment<P extends IPresenter> extends RxFragment implements IFragment { // @Inject // public P mPresenter; // // protected View rootView; // private Unbinder unbinder; // private OnCallbackListener callbackListener; // // public interface OnCallbackListener { // void onCallback(CallbackObject callbackObject); // } // // @Override // public void onCreate(@Nullable Bundle savedInstanceState) { // super.onCreate(savedInstanceState); // setRetainInstance(true); // } // // @Nullable // @Override // public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { // preInitLayout(); // rootView = LayoutInflater.from(getContext()).inflate(getLayoutId(), container, false); // unbinder = ButterKnife.bind(this, rootView); // return rootView; // } // // public void preInitLayout() { // } // // @Override // public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { // super.onViewCreated(view, savedInstanceState); // bindView(); // bindMenu(); // } // // @Override // public void onDestroyView() { // super.onDestroyView(); // unBindView(); // unBindMenu(); // } // // @Override // public void onDestroy() { // super.onDestroy(); // if (mPresenter != null) { // mPresenter.onDestroy(); // } // mPresenter = null; // } // // public abstract int getLayoutId(); // // public void bindView() { // } // // public void unBindView() { // if (unbinder != null) { // unbinder.unbind(); // } // } // // public void bindMenu() { // } // // public void unBindMenu() { // } // // public BaseActivity getBaseActivity() { // if (getActivity() instanceof BaseActivity) { // return (BaseActivity) getActivity(); // } else { // throw new NullPointerException("Can't cast this activity to BaseActivity"); // } // } // // public OnCallbackListener getCallbackListener() { // return callbackListener; // } // // public void setCallbackListener(OnCallbackListener callbackListener) { // this.callbackListener = callbackListener; // } // // public FragmentHelper getFragmentHelper() { // if (getBaseActivity() instanceof BaseMainActivity) { // return ((BaseMainActivity) getBaseActivity()).fragmentHelper; // } else { // throw new NullPointerException("Can't find Fragment Helper"); // } // } // // }
import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import java.util.ArrayList; import java.util.List; import java.util.Stack; import vn.eazy.base.mvp.R; import vn.eazy.base.mvp.base.fragment.BaseFragment;
package vn.eazy.base.mvp.helper; /** * Created by Liam Vo on 3/3/17. */ public class FragmentStateHelper implements OnFragmentStateAction { private FragmentManager fragmentManager; private int idContent = R.id.fragment_content; private int stackSelected = -1; private int tagCount;
// Path: code/base/src/main/java/vn/eazy/base/mvp/base/fragment/BaseFragment.java // public abstract class BaseFragment<P extends IPresenter> extends RxFragment implements IFragment { // @Inject // public P mPresenter; // // protected View rootView; // private Unbinder unbinder; // private OnCallbackListener callbackListener; // // public interface OnCallbackListener { // void onCallback(CallbackObject callbackObject); // } // // @Override // public void onCreate(@Nullable Bundle savedInstanceState) { // super.onCreate(savedInstanceState); // setRetainInstance(true); // } // // @Nullable // @Override // public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { // preInitLayout(); // rootView = LayoutInflater.from(getContext()).inflate(getLayoutId(), container, false); // unbinder = ButterKnife.bind(this, rootView); // return rootView; // } // // public void preInitLayout() { // } // // @Override // public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { // super.onViewCreated(view, savedInstanceState); // bindView(); // bindMenu(); // } // // @Override // public void onDestroyView() { // super.onDestroyView(); // unBindView(); // unBindMenu(); // } // // @Override // public void onDestroy() { // super.onDestroy(); // if (mPresenter != null) { // mPresenter.onDestroy(); // } // mPresenter = null; // } // // public abstract int getLayoutId(); // // public void bindView() { // } // // public void unBindView() { // if (unbinder != null) { // unbinder.unbind(); // } // } // // public void bindMenu() { // } // // public void unBindMenu() { // } // // public BaseActivity getBaseActivity() { // if (getActivity() instanceof BaseActivity) { // return (BaseActivity) getActivity(); // } else { // throw new NullPointerException("Can't cast this activity to BaseActivity"); // } // } // // public OnCallbackListener getCallbackListener() { // return callbackListener; // } // // public void setCallbackListener(OnCallbackListener callbackListener) { // this.callbackListener = callbackListener; // } // // public FragmentHelper getFragmentHelper() { // if (getBaseActivity() instanceof BaseMainActivity) { // return ((BaseMainActivity) getBaseActivity()).fragmentHelper; // } else { // throw new NullPointerException("Can't find Fragment Helper"); // } // } // // } // Path: code/base/src/main/java/vn/eazy/base/mvp/helper/FragmentStateHelper.java import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import java.util.ArrayList; import java.util.List; import java.util.Stack; import vn.eazy.base.mvp.R; import vn.eazy.base.mvp.base.fragment.BaseFragment; package vn.eazy.base.mvp.helper; /** * Created by Liam Vo on 3/3/17. */ public class FragmentStateHelper implements OnFragmentStateAction { private FragmentManager fragmentManager; private int idContent = R.id.fragment_content; private int stackSelected = -1; private int tagCount;
private List<Stack<BaseFragment>> stacksFragment;
rodolfoliviero/vraptor-scaffold
spec/lib/generators/scaffold_generator/controller_generator/templates/ProductController.java
// Path: spec/lib/generators/scaffold_generator/model_generator/templates/Product.java // @javax.persistence.Entity // public class Product extends Entity { // // private String name; // private boolean flag; // // public void setName(String name) { // this.name = name; // } // // public String getName() { // return name; // } // // public void setFlag(boolean flag) { // this.flag = flag; // } // // public boolean getFlag() { // return flag; // } // // } // // Path: spec/lib/generators/scaffold_generator/repository_generator/templates/ProductRepository.java // public interface ProductRepository { // /* // * Delete the methods you don't want to expose // */ // // void create(Product entity); // // void update(Product entity); // // void destroy(Product entity); // // Product find(Long id); // // List<Product> findAll(); // // }
import java.util.List; import app.models.Product; import app.repositories.ProductRepository; import br.com.caelum.vraptor.Delete; import br.com.caelum.vraptor.Get; import br.com.caelum.vraptor.Path; import br.com.caelum.vraptor.Post; import br.com.caelum.vraptor.Put; import br.com.caelum.vraptor.Resource; import br.com.caelum.vraptor.Result; import br.com.caelum.vraptor.Validator;
package app.controllers; @Resource public class ProductController { private final Result result;
// Path: spec/lib/generators/scaffold_generator/model_generator/templates/Product.java // @javax.persistence.Entity // public class Product extends Entity { // // private String name; // private boolean flag; // // public void setName(String name) { // this.name = name; // } // // public String getName() { // return name; // } // // public void setFlag(boolean flag) { // this.flag = flag; // } // // public boolean getFlag() { // return flag; // } // // } // // Path: spec/lib/generators/scaffold_generator/repository_generator/templates/ProductRepository.java // public interface ProductRepository { // /* // * Delete the methods you don't want to expose // */ // // void create(Product entity); // // void update(Product entity); // // void destroy(Product entity); // // Product find(Long id); // // List<Product> findAll(); // // } // Path: spec/lib/generators/scaffold_generator/controller_generator/templates/ProductController.java import java.util.List; import app.models.Product; import app.repositories.ProductRepository; import br.com.caelum.vraptor.Delete; import br.com.caelum.vraptor.Get; import br.com.caelum.vraptor.Path; import br.com.caelum.vraptor.Post; import br.com.caelum.vraptor.Put; import br.com.caelum.vraptor.Resource; import br.com.caelum.vraptor.Result; import br.com.caelum.vraptor.Validator; package app.controllers; @Resource public class ProductController { private final Result result;
private final ProductRepository repository;
rodolfoliviero/vraptor-scaffold
spec/lib/generators/scaffold_generator/controller_generator/templates/ProductController.java
// Path: spec/lib/generators/scaffold_generator/model_generator/templates/Product.java // @javax.persistence.Entity // public class Product extends Entity { // // private String name; // private boolean flag; // // public void setName(String name) { // this.name = name; // } // // public String getName() { // return name; // } // // public void setFlag(boolean flag) { // this.flag = flag; // } // // public boolean getFlag() { // return flag; // } // // } // // Path: spec/lib/generators/scaffold_generator/repository_generator/templates/ProductRepository.java // public interface ProductRepository { // /* // * Delete the methods you don't want to expose // */ // // void create(Product entity); // // void update(Product entity); // // void destroy(Product entity); // // Product find(Long id); // // List<Product> findAll(); // // }
import java.util.List; import app.models.Product; import app.repositories.ProductRepository; import br.com.caelum.vraptor.Delete; import br.com.caelum.vraptor.Get; import br.com.caelum.vraptor.Path; import br.com.caelum.vraptor.Post; import br.com.caelum.vraptor.Put; import br.com.caelum.vraptor.Resource; import br.com.caelum.vraptor.Result; import br.com.caelum.vraptor.Validator;
package app.controllers; @Resource public class ProductController { private final Result result; private final ProductRepository repository; private final Validator validator; public ProductController(Result result, ProductRepository repository, Validator validator) { this.result = result; this.repository = repository; this.validator = validator; } @Get @Path("/products")
// Path: spec/lib/generators/scaffold_generator/model_generator/templates/Product.java // @javax.persistence.Entity // public class Product extends Entity { // // private String name; // private boolean flag; // // public void setName(String name) { // this.name = name; // } // // public String getName() { // return name; // } // // public void setFlag(boolean flag) { // this.flag = flag; // } // // public boolean getFlag() { // return flag; // } // // } // // Path: spec/lib/generators/scaffold_generator/repository_generator/templates/ProductRepository.java // public interface ProductRepository { // /* // * Delete the methods you don't want to expose // */ // // void create(Product entity); // // void update(Product entity); // // void destroy(Product entity); // // Product find(Long id); // // List<Product> findAll(); // // } // Path: spec/lib/generators/scaffold_generator/controller_generator/templates/ProductController.java import java.util.List; import app.models.Product; import app.repositories.ProductRepository; import br.com.caelum.vraptor.Delete; import br.com.caelum.vraptor.Get; import br.com.caelum.vraptor.Path; import br.com.caelum.vraptor.Post; import br.com.caelum.vraptor.Put; import br.com.caelum.vraptor.Resource; import br.com.caelum.vraptor.Result; import br.com.caelum.vraptor.Validator; package app.controllers; @Resource public class ProductController { private final Result result; private final ProductRepository repository; private final Validator validator; public ProductController(Result result, ProductRepository repository, Validator validator) { this.result = result; this.repository = repository; this.validator = validator; } @Get @Path("/products")
public List<Product> index() {
rodolfoliviero/vraptor-scaffold
spec/lib/generators/scaffold_generator/repository_generator/templates/ProductRepositoryImpl.java
// Path: spec/lib/generators/scaffold_generator/model_generator/templates/Product.java // @javax.persistence.Entity // public class Product extends Entity { // // private String name; // private boolean flag; // // public void setName(String name) { // this.name = name; // } // // public String getName() { // return name; // } // // public void setFlag(boolean flag) { // this.flag = flag; // } // // public boolean getFlag() { // return flag; // } // // }
import javax.persistence.EntityManager; import br.com.caelum.vraptor.ioc.Component; import app.models.Product;
package app.repositories; @Component public class ProductRepositoryImpl
// Path: spec/lib/generators/scaffold_generator/model_generator/templates/Product.java // @javax.persistence.Entity // public class Product extends Entity { // // private String name; // private boolean flag; // // public void setName(String name) { // this.name = name; // } // // public String getName() { // return name; // } // // public void setFlag(boolean flag) { // this.flag = flag; // } // // public boolean getFlag() { // return flag; // } // // } // Path: spec/lib/generators/scaffold_generator/repository_generator/templates/ProductRepositoryImpl.java import javax.persistence.EntityManager; import br.com.caelum.vraptor.ioc.Component; import app.models.Product; package app.repositories; @Component public class ProductRepositoryImpl
extends Repository<Product, Long>
jmhertlein/MCTowns
src/main/java/cafe/josh/mctowns/region/MCTownsRegion.java
// Path: src/main/java/cafe/josh/mctowns/MCTowns.java // public class MCTowns { // private static WorldGuardPlugin wgp; // // public static String getConfigSummary() { // return MCTownsPlugin.getPlugin().getConfig().saveToString(); // } // // public static void logInfo(String msg) { // if(MCTownsPlugin.getPlugin() == null) { // System.out.println(msg); // } else { // MCTownsPlugin.getPlugin().getLogger().log(Level.INFO, msg); // } // } // // public static void logWarning(String msg) { // MCTownsPlugin.getPlugin().getLogger().log(Level.WARNING, msg); // } // // public static void logSevere(String msg) { // MCTownsPlugin.getPlugin().getLogger().log(Level.SEVERE, msg); // } // // public static void logDebug(String msg) { // if(MCTConfig.DEBUG_MODE_ENABLED.getBoolean()) { // logInfo("[DEBUG]: " + msg); // } // } // // public static Economy getEconomy() { // RegisteredServiceProvider<Economy> economyProvider = Bukkit.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class); // // return economyProvider != null ? economyProvider.getProvider() : null; // } // // public static WorldGuardPlugin getWorldGuardPlugin() { // if(wgp != null) { // return wgp; // } // // Plugin p = Bukkit.getServer().getPluginManager().getPlugin("WorldGuard"); // if(p instanceof WorldGuardPlugin) { // wgp = (WorldGuardPlugin) p; // } else { // wgp = null; // } // // return wgp; // } // // public static TownManager getTownManager() { // return MCTownsPlugin.getPlugin().getTownManager(); // } // // public static void persistTownManager() { // MCTownsPlugin.getPlugin().persistTownManager(); // } // }
import com.sk89q.worldguard.bukkit.WorldGuardPlugin; import com.sk89q.worldguard.domains.DefaultDomain; import com.sk89q.worldguard.protection.regions.ProtectedRegion; import java.util.Objects; import java.util.UUID; import cafe.josh.mctowns.MCTowns; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; import org.bukkit.World; import org.bukkit.configuration.file.FileConfiguration;
/* * Copyright (C) 2013 Joshua Michael Hertlein <jmhertlein@gmail.com> * * 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 cafe.josh.mctowns.region; /** * * @author joshua */ public abstract class MCTownsRegion { private static final long serialVersionUID = "MCTOWNSREGION".hashCode(); // DO NOT CHANGE private static final int VERSION = 0; /** * The name of the region, the name of the world in which the region exists */ protected volatile String name, worldName; public MCTownsRegion() { } /** * creates a new region with the name name, and sets its world to be * worldname * * @param name the name of the new region * @param worldName the world of the new region */ public MCTownsRegion(String name, String worldName) { this.name = name.toLowerCase(); this.worldName = worldName; } /** * * @return the name of the region */ public String getName() { return name; } /** * * @return the name of the world in which the region resides */ public String getWorldName() { return worldName; } /** * * @param playerID * * @return */ public boolean removePlayer(UUID playerID) { DefaultDomain members, owners; boolean removed = false;
// Path: src/main/java/cafe/josh/mctowns/MCTowns.java // public class MCTowns { // private static WorldGuardPlugin wgp; // // public static String getConfigSummary() { // return MCTownsPlugin.getPlugin().getConfig().saveToString(); // } // // public static void logInfo(String msg) { // if(MCTownsPlugin.getPlugin() == null) { // System.out.println(msg); // } else { // MCTownsPlugin.getPlugin().getLogger().log(Level.INFO, msg); // } // } // // public static void logWarning(String msg) { // MCTownsPlugin.getPlugin().getLogger().log(Level.WARNING, msg); // } // // public static void logSevere(String msg) { // MCTownsPlugin.getPlugin().getLogger().log(Level.SEVERE, msg); // } // // public static void logDebug(String msg) { // if(MCTConfig.DEBUG_MODE_ENABLED.getBoolean()) { // logInfo("[DEBUG]: " + msg); // } // } // // public static Economy getEconomy() { // RegisteredServiceProvider<Economy> economyProvider = Bukkit.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class); // // return economyProvider != null ? economyProvider.getProvider() : null; // } // // public static WorldGuardPlugin getWorldGuardPlugin() { // if(wgp != null) { // return wgp; // } // // Plugin p = Bukkit.getServer().getPluginManager().getPlugin("WorldGuard"); // if(p instanceof WorldGuardPlugin) { // wgp = (WorldGuardPlugin) p; // } else { // wgp = null; // } // // return wgp; // } // // public static TownManager getTownManager() { // return MCTownsPlugin.getPlugin().getTownManager(); // } // // public static void persistTownManager() { // MCTownsPlugin.getPlugin().persistTownManager(); // } // } // Path: src/main/java/cafe/josh/mctowns/region/MCTownsRegion.java import com.sk89q.worldguard.bukkit.WorldGuardPlugin; import com.sk89q.worldguard.domains.DefaultDomain; import com.sk89q.worldguard.protection.regions.ProtectedRegion; import java.util.Objects; import java.util.UUID; import cafe.josh.mctowns.MCTowns; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; import org.bukkit.World; import org.bukkit.configuration.file.FileConfiguration; /* * Copyright (C) 2013 Joshua Michael Hertlein <jmhertlein@gmail.com> * * 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 cafe.josh.mctowns.region; /** * * @author joshua */ public abstract class MCTownsRegion { private static final long serialVersionUID = "MCTOWNSREGION".hashCode(); // DO NOT CHANGE private static final int VERSION = 0; /** * The name of the region, the name of the world in which the region exists */ protected volatile String name, worldName; public MCTownsRegion() { } /** * creates a new region with the name name, and sets its world to be * worldname * * @param name the name of the new region * @param worldName the world of the new region */ public MCTownsRegion(String name, String worldName) { this.name = name.toLowerCase(); this.worldName = worldName; } /** * * @return the name of the region */ public String getName() { return name; } /** * * @return the name of the world in which the region resides */ public String getWorldName() { return worldName; } /** * * @param playerID * * @return */ public boolean removePlayer(UUID playerID) { DefaultDomain members, owners; boolean removed = false;
WorldGuardPlugin wgp = MCTowns.getWorldGuardPlugin();
jmhertlein/MCTowns
src/main/java/cafe/josh/mctowns/MCTowns.java
// Path: src/main/java/cafe/josh/mctowns/util/MCTConfig.java // public enum MCTConfig { // WG_VER_REGEX("wgRequirement", ".*"), // DEFAULT_TOWN("defaultTown", null), // ECONOMY_ENABLED("economyEnabled", false), // MAYORS_CAN_BUY_TERRITORIES("mayorsCanBuyTerritories", false), // PRICE_PER_XZ_BLOCK("pricePerXZBlock", 0), // MIN_NUM_PLAYERS_TO_BUY_TERRITORY("minNumPlayersToBuyTerritory", 3), // ALLOW_TOWN_FRIENDLY_FIRE_MANAGEMENT("allowTownFriendlyFireManagement", true), // QUICKSELECT_TOOL("quickSelectTool", "WOOD_HOE"), // LOG_COMMANDS("logCommands", true), // PLAYERS_CAN_JOIN_MULTIPLE_TOWNS("playersCanJoinMultipleTowns", false), // TERRITORY_XZ_SIZE_LIMIT("territoryXZSizeLimit", 800), // DEBUG_MODE_ENABLED("debugModeEnabled", false), // CURRENCY_INPUT_PATTERN("currencyInputPattern", "^\\d{1,10}(\\.\\d{1,10})?$"); // // private static final MCTownsPlugin p = MCTownsPlugin.getPlugin(); // // private final Object dflt; // private final String key; // // private MCTConfig(String key, Object dflt) { // this.dflt = dflt; // this.key = key; // } // // public void set(Object value) { // MCTownsPlugin.getPlugin().getConfig().set(getKey(), value); // } // // public Object getObject() { // return p == null ? dflt : p.getConfig().get(this.getKey(), dflt); // } // // public int getInt() { // return p == null ? (int) dflt : p.getConfig().getInt(this.getKey(), (int) dflt); // } // // public String getString() { // String defString = dflt == null ? null : dflt.toString(); // return p == null ? defString : p.getConfig().getString(this.getKey(), defString); // } // // public boolean getBoolean() { // return p == null ? (boolean) dflt : p.getConfig().getBoolean(this.getKey(), (boolean) dflt); // } // // public String getKey() { // return key; // } // }
import com.sk89q.worldguard.bukkit.WorldGuardPlugin; import java.util.logging.Level; import cafe.josh.mctowns.util.MCTConfig; import net.milkbowl.vault.economy.Economy; import org.bukkit.Bukkit; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.RegisteredServiceProvider;
/* * Copyright (C) 2013 Joshua Michael Hertlein <jmhertlein@gmail.com> * * 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 cafe.josh.mctowns; /** * * @author joshua */ public class MCTowns { private static WorldGuardPlugin wgp; public static String getConfigSummary() { return MCTownsPlugin.getPlugin().getConfig().saveToString(); } public static void logInfo(String msg) { if(MCTownsPlugin.getPlugin() == null) { System.out.println(msg); } else { MCTownsPlugin.getPlugin().getLogger().log(Level.INFO, msg); } } public static void logWarning(String msg) { MCTownsPlugin.getPlugin().getLogger().log(Level.WARNING, msg); } public static void logSevere(String msg) { MCTownsPlugin.getPlugin().getLogger().log(Level.SEVERE, msg); } public static void logDebug(String msg) {
// Path: src/main/java/cafe/josh/mctowns/util/MCTConfig.java // public enum MCTConfig { // WG_VER_REGEX("wgRequirement", ".*"), // DEFAULT_TOWN("defaultTown", null), // ECONOMY_ENABLED("economyEnabled", false), // MAYORS_CAN_BUY_TERRITORIES("mayorsCanBuyTerritories", false), // PRICE_PER_XZ_BLOCK("pricePerXZBlock", 0), // MIN_NUM_PLAYERS_TO_BUY_TERRITORY("minNumPlayersToBuyTerritory", 3), // ALLOW_TOWN_FRIENDLY_FIRE_MANAGEMENT("allowTownFriendlyFireManagement", true), // QUICKSELECT_TOOL("quickSelectTool", "WOOD_HOE"), // LOG_COMMANDS("logCommands", true), // PLAYERS_CAN_JOIN_MULTIPLE_TOWNS("playersCanJoinMultipleTowns", false), // TERRITORY_XZ_SIZE_LIMIT("territoryXZSizeLimit", 800), // DEBUG_MODE_ENABLED("debugModeEnabled", false), // CURRENCY_INPUT_PATTERN("currencyInputPattern", "^\\d{1,10}(\\.\\d{1,10})?$"); // // private static final MCTownsPlugin p = MCTownsPlugin.getPlugin(); // // private final Object dflt; // private final String key; // // private MCTConfig(String key, Object dflt) { // this.dflt = dflt; // this.key = key; // } // // public void set(Object value) { // MCTownsPlugin.getPlugin().getConfig().set(getKey(), value); // } // // public Object getObject() { // return p == null ? dflt : p.getConfig().get(this.getKey(), dflt); // } // // public int getInt() { // return p == null ? (int) dflt : p.getConfig().getInt(this.getKey(), (int) dflt); // } // // public String getString() { // String defString = dflt == null ? null : dflt.toString(); // return p == null ? defString : p.getConfig().getString(this.getKey(), defString); // } // // public boolean getBoolean() { // return p == null ? (boolean) dflt : p.getConfig().getBoolean(this.getKey(), (boolean) dflt); // } // // public String getKey() { // return key; // } // } // Path: src/main/java/cafe/josh/mctowns/MCTowns.java import com.sk89q.worldguard.bukkit.WorldGuardPlugin; import java.util.logging.Level; import cafe.josh.mctowns.util.MCTConfig; import net.milkbowl.vault.economy.Economy; import org.bukkit.Bukkit; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.RegisteredServiceProvider; /* * Copyright (C) 2013 Joshua Michael Hertlein <jmhertlein@gmail.com> * * 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 cafe.josh.mctowns; /** * * @author joshua */ public class MCTowns { private static WorldGuardPlugin wgp; public static String getConfigSummary() { return MCTownsPlugin.getPlugin().getConfig().saveToString(); } public static void logInfo(String msg) { if(MCTownsPlugin.getPlugin() == null) { System.out.println(msg); } else { MCTownsPlugin.getPlugin().getLogger().log(Level.INFO, msg); } } public static void logWarning(String msg) { MCTownsPlugin.getPlugin().getLogger().log(Level.WARNING, msg); } public static void logSevere(String msg) { MCTownsPlugin.getPlugin().getLogger().log(Level.SEVERE, msg); } public static void logDebug(String msg) {
if(MCTConfig.DEBUG_MODE_ENABLED.getBoolean()) {
jmhertlein/MCTowns
src/main/java/cafe/josh/mctowns/region/Plot.java
// Path: src/main/java/cafe/josh/mctowns/MCTowns.java // public class MCTowns { // private static WorldGuardPlugin wgp; // // public static String getConfigSummary() { // return MCTownsPlugin.getPlugin().getConfig().saveToString(); // } // // public static void logInfo(String msg) { // if(MCTownsPlugin.getPlugin() == null) { // System.out.println(msg); // } else { // MCTownsPlugin.getPlugin().getLogger().log(Level.INFO, msg); // } // } // // public static void logWarning(String msg) { // MCTownsPlugin.getPlugin().getLogger().log(Level.WARNING, msg); // } // // public static void logSevere(String msg) { // MCTownsPlugin.getPlugin().getLogger().log(Level.SEVERE, msg); // } // // public static void logDebug(String msg) { // if(MCTConfig.DEBUG_MODE_ENABLED.getBoolean()) { // logInfo("[DEBUG]: " + msg); // } // } // // public static Economy getEconomy() { // RegisteredServiceProvider<Economy> economyProvider = Bukkit.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class); // // return economyProvider != null ? economyProvider.getProvider() : null; // } // // public static WorldGuardPlugin getWorldGuardPlugin() { // if(wgp != null) { // return wgp; // } // // Plugin p = Bukkit.getServer().getPluginManager().getPlugin("WorldGuard"); // if(p instanceof WorldGuardPlugin) { // wgp = (WorldGuardPlugin) p; // } else { // wgp = null; // } // // return wgp; // } // // public static TownManager getTownManager() { // return MCTownsPlugin.getPlugin().getTownManager(); // } // // public static void persistTownManager() { // MCTownsPlugin.getPlugin().persistTownManager(); // } // }
import com.sk89q.worldedit.Vector; import com.sk89q.worldguard.bukkit.WorldGuardPlugin; import com.sk89q.worldguard.protection.regions.ProtectedRegion; import java.math.BigDecimal; import net.jmhertlein.core.location.Location; import cafe.josh.mctowns.MCTowns; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.block.Sign; import org.bukkit.configuration.file.FileConfiguration;
/* * Copyright (C) 2013 Joshua Michael Hertlein <jmhertlein@gmail.com> * * 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 cafe.josh.mctowns.region; /** * * @author joshua */ public class Plot extends MCTownsRegion { private static final long serialVersionUID = "PLOT".hashCode(); // DO NOT CHANGE private volatile String parTerrName; private volatile String parTownName; private boolean forSale; private volatile BigDecimal price; private volatile Location signLoc; /** * Creates a new plot with the specified properties. * * @param name * @param worldName * @param parentTerritoryName * @param parentTownName */ public Plot(String name, String worldName, String parentTerritoryName, String parentTownName) { super(name, worldName);
// Path: src/main/java/cafe/josh/mctowns/MCTowns.java // public class MCTowns { // private static WorldGuardPlugin wgp; // // public static String getConfigSummary() { // return MCTownsPlugin.getPlugin().getConfig().saveToString(); // } // // public static void logInfo(String msg) { // if(MCTownsPlugin.getPlugin() == null) { // System.out.println(msg); // } else { // MCTownsPlugin.getPlugin().getLogger().log(Level.INFO, msg); // } // } // // public static void logWarning(String msg) { // MCTownsPlugin.getPlugin().getLogger().log(Level.WARNING, msg); // } // // public static void logSevere(String msg) { // MCTownsPlugin.getPlugin().getLogger().log(Level.SEVERE, msg); // } // // public static void logDebug(String msg) { // if(MCTConfig.DEBUG_MODE_ENABLED.getBoolean()) { // logInfo("[DEBUG]: " + msg); // } // } // // public static Economy getEconomy() { // RegisteredServiceProvider<Economy> economyProvider = Bukkit.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class); // // return economyProvider != null ? economyProvider.getProvider() : null; // } // // public static WorldGuardPlugin getWorldGuardPlugin() { // if(wgp != null) { // return wgp; // } // // Plugin p = Bukkit.getServer().getPluginManager().getPlugin("WorldGuard"); // if(p instanceof WorldGuardPlugin) { // wgp = (WorldGuardPlugin) p; // } else { // wgp = null; // } // // return wgp; // } // // public static TownManager getTownManager() { // return MCTownsPlugin.getPlugin().getTownManager(); // } // // public static void persistTownManager() { // MCTownsPlugin.getPlugin().persistTownManager(); // } // } // Path: src/main/java/cafe/josh/mctowns/region/Plot.java import com.sk89q.worldedit.Vector; import com.sk89q.worldguard.bukkit.WorldGuardPlugin; import com.sk89q.worldguard.protection.regions.ProtectedRegion; import java.math.BigDecimal; import net.jmhertlein.core.location.Location; import cafe.josh.mctowns.MCTowns; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.block.Sign; import org.bukkit.configuration.file.FileConfiguration; /* * Copyright (C) 2013 Joshua Michael Hertlein <jmhertlein@gmail.com> * * 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 cafe.josh.mctowns.region; /** * * @author joshua */ public class Plot extends MCTownsRegion { private static final long serialVersionUID = "PLOT".hashCode(); // DO NOT CHANGE private volatile String parTerrName; private volatile String parTownName; private boolean forSale; private volatile BigDecimal price; private volatile Location signLoc; /** * Creates a new plot with the specified properties. * * @param name * @param worldName * @param parentTerritoryName * @param parentTownName */ public Plot(String name, String worldName, String parentTerritoryName, String parentTownName) { super(name, worldName);
price = MCTowns.getTownManager().getTown(parentTownName).getDefaultPlotPrice();