Search in sources :

Example 1 with CustomerService

use of eu.ggnet.dwoss.customer.opi.CustomerService in project dwoss by gg-net.

the class CreateCustomerTryout method main.

public static void main(String[] args) {
    Dl.remote().add(Mandators.class, mock(Mandators.class));
    Dl.local().add(Guardian.class, new AbstractGuardian() {

        {
            setAllUsersnames(Arrays.asList("hans", "claus", "peter"));
        }

        @Override
        public void login(String user, char[] pass) throws AuthenticationException {
        }
    });
    Dl.remote().add(OldCustomerAgent.class, new OldCustomerAgent() {

        @Override
        public OldCustomer findById(long id) {
            OldCustomer customer = new OldCustomer("Die Firma", "Herr", "Max", "Mustermann", "Keine Bemerkungen die ganz lang sein muss um zu testen ob die tabelle richtig funzt, was erst bei richtig richtig langem text auffällt und olli sicher nervt xD", "Helle Strasse 22", "12345", "Musterhausen", "LIStraße", "LIPLZ", "LIOrt");
            customer.setKundenID(1);
            customer.setTelefonnummer("0190 666666");
            customer.setHandynummer("0123456789");
            customer.setPaymentMethod(PaymentMethod.ADVANCE_PAYMENT);
            customer.setPaymentCondition(PaymentCondition.DEALER);
            customer.setShippingCondition(ShippingCondition.DEALER_ONE);
            customer.setAllowedSalesChannels(EnumSet.of(SalesChannel.CUSTOMER, SalesChannel.RETAILER));
            customer.addFlag(CustomerFlag.CONFIRMS_DOSSIER);
            customer.setHaendler(true);
            return customer;
        }

        @Override
        public OldCustomer store(OldCustomer old) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }
    });
    Dl.remote().add(CustomerService.class, new CustomerService() {

        @Override
        public List<UiCustomer> asUiCustomers(String company, String firstName, String lastName, String email, boolean appendWildcard) {
            L.info("call of asUiCustomers(company={},firstName={},lastName={},email={},wildCard={}", company, firstName, lastName, email, appendWildcard);
            return new ArrayList<>();
        }

        // <editor-fold defaultstate="collapsed" desc="Unused Methods">
        @Override
        public CustomerMetaData asCustomerMetaData(long customerId) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public UiCustomer asUiCustomer(long customerId) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public List<UiCustomer> asUiCustomers(String search) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public String asHtmlHighDetailed(long id) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public String findComment(long id) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public void updateCustomerFlags(long customerId, Set<CustomerFlag> flags) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public List<CustomerMetaData> allAsCustomerMetaData() {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public List<Long> allSystemCustomerIds() {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public String asNewHtmlHighDetailed(long id) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }
    });
    CustomerCreateWithSearchView view = new CustomerCreateWithSearchView();
    CustomerCreateWithSearchController controller = new CustomerCreateWithSearchController();
    controller.setView(view);
    view.setController(controller);
    OkCancelDialog<CustomerCreateWithSearchView> dialog = new OkCancelDialog<>("Kundenmanagement", view);
    dialog.setVisible(true);
    System.out.println(view.getCustomer());
    System.exit(0);
}
Also used : CustomerService(eu.ggnet.dwoss.customer.opi.CustomerService) OldCustomer(eu.ggnet.dwoss.customer.ee.priv.OldCustomer) OldCustomerAgent(eu.ggnet.dwoss.customer.ee.priv.OldCustomerAgent) AuthenticationException(eu.ggnet.saft.core.auth.AuthenticationException) CustomerMetaData(eu.ggnet.dwoss.customer.opi.CustomerMetaData) OkCancelDialog(eu.ggnet.dwoss.util.OkCancelDialog) AbstractGuardian(eu.ggnet.dwoss.common.AbstractGuardian) CustomerCreateWithSearchController(eu.ggnet.dwoss.customer.ui.old.CustomerCreateWithSearchController) CustomerCreateWithSearchView(eu.ggnet.dwoss.customer.ui.old.CustomerCreateWithSearchView) Mandators(eu.ggnet.dwoss.mandator.Mandators) UiCustomer(eu.ggnet.dwoss.customer.opi.UiCustomer)

Aggregations

AbstractGuardian (eu.ggnet.dwoss.common.AbstractGuardian)1 OldCustomer (eu.ggnet.dwoss.customer.ee.priv.OldCustomer)1 OldCustomerAgent (eu.ggnet.dwoss.customer.ee.priv.OldCustomerAgent)1 CustomerMetaData (eu.ggnet.dwoss.customer.opi.CustomerMetaData)1 CustomerService (eu.ggnet.dwoss.customer.opi.CustomerService)1 UiCustomer (eu.ggnet.dwoss.customer.opi.UiCustomer)1 CustomerCreateWithSearchController (eu.ggnet.dwoss.customer.ui.old.CustomerCreateWithSearchController)1 CustomerCreateWithSearchView (eu.ggnet.dwoss.customer.ui.old.CustomerCreateWithSearchView)1 Mandators (eu.ggnet.dwoss.mandator.Mandators)1 OkCancelDialog (eu.ggnet.dwoss.util.OkCancelDialog)1 AuthenticationException (eu.ggnet.saft.core.auth.AuthenticationException)1