Package de.fhdw.ify208.ticketmaster.webapp.model

Examples of de.fhdw.ify208.ticketmaster.webapp.model.UserProfile


     */
    public CustomerDTO signOn(String userName, String password) {
        CustomerDTO customerDTO = new CustomerDTO();
        EntityMapper mapper = new EntityMapper();
        // get Customer by userName
        User customer = _checkCustomerExistsByName(userName);
        if (customer != null) {
            // check password for Customer
            if (customer.getPassword().equals(password)) {
                // build CustomerDTO
                customerDTO = mapper.getCustomerDTOFromUser(customer);
            } else {
                customerDTO.setReturncode(99);
                customerDTO.setMessage("Password mismatch.");
View Full Code Here


     * @return BaseDTO
     */
    public BaseDTO changePassword(String userName, String oldPassword, String newPassword) {
        BaseDTO baseDTO = new BaseDTO();
        // get Customer by userName
        User customer = _checkCustomerExistsByName(userName);
        if (customer != null) {
            // check password for Customer
            if (customer.getPassword().equals(oldPassword)) {
                // update customer
                customer.setPassword(newPassword);
                customer = _updateCustomer(customer);
                if (customer == null) {
                    baseDTO.setReturncode(99);
                    baseDTO.setMessage("Error during update of password.");
                }
View Full Code Here

     */
    public CustomerDTO registerCustomer(CustomerDTO theCustomer) {
        CustomerDTO customerDTO = new CustomerDTO();
        EntityMapper mapper = new EntityMapper();
        // check username is not in use
        User customer = _checkCustomerExistsByName(theCustomer.getUserName());
        if (customer == null) {
            // map customerDTO to customer
            customer = mapper.getUserFromCustomerDTO(theCustomer);
            // write customer to database
            customer = _insertCustomer(customer);
View Full Code Here

     * @param theCustomer
     * @param theAddress
     * @return AddressDTO
     */
    public AddressDTO maintainAddress(CustomerDTO theCustomer, AddressDTO theAddress) {
        User customer = null;
        Address address = null;
        EntityMapper mapper = new EntityMapper();
        AddressDTO addressDTO = null;

        if (theAddress.getid() != null) {
            // address has an id, so just update the address itself
            address = _updateAddress(mapper.getAddressfromAddressDTO(theAddress));
            if (address == null) {
                addressDTO = new AddressDTO();
                addressDTO.setReturncode(99);
                addressDTO.setMessage("Error during update of customers addressdata.");
            } else {
                addressDTO = mapper.getAddressDTOfromAddress(address);
            }
        } else {
            customer = _checkCustomerExists(theCustomer.getid());
            // address has no id, put it to customer and update customer
            if (customer != null) {
                customer.getAddresses().add(mapper.getAddressfromAddressDTO(theAddress));
                customer = _updateCustomer(customer);
                if (customer != null) {
                    address = _findNewAddressFromCustomer(customer);
                    addressDTO = mapper.getAddressDTOfromAddress(address);
                } else {
View Full Code Here

     */
    public BaseDTO removeAddress(CustomerDTO theCustomer, AddressDTO theAddress) {
        BaseDTO baseDTO = new BaseDTO();
        // check address exists
        Address address = _checkAddressExists(theAddress.getid());
        User customer = _checkCustomerExists(theCustomer.getid());
        if (address != null && customer != null) {
            customer = _removeCustomerAddress(customer, address.getId());
            if (customer != null) {
                customer = _updateCustomer(customer);
                if (customer == null) {
View Full Code Here

     * Internal methode for check existance of user by username
     */
    private User _checkCustomerExistsByName(String userName) {
        // local variables
        EntityManager _em = null;
        User customer = null;

        // logic
        try {
            // startup-sequence
            _em = _startup();
View Full Code Here

    }

    private User _insertCustomer(User customer) {
        // local variables
        EntityManager _em = null;
        User _customer = null;

        // logic
        try {
            // startup-sequence
            _em = _startup();
View Full Code Here

    /**
     * constructs a new user controller and connects to the local customer web service
     */
    public UserController() {

        _logonCredentials = new LogonCredentials();

        try {

            _customerWebService = new CustomerServiceImplService(
                    new URL(String.format("http://%s/ticketmaster/customerservice?wsdl", SystemController.getHost())),
View Full Code Here

        } catch (Exception ex) {

            bIsLoggedIn = false;

            _loggedOnUser = null;
            _logonCredentials = new LogonCredentials();

            msg = new FacesMessage(FacesMessage.SEVERITY_FATAL, "Error communicating with customer web service!",
                    String.format("Unable to access customer web service at %s: %s",
                            _customerWebService.getWSDLDocumentLocation(),
                            ex.getMessage()));
View Full Code Here

        RequestContext ctx = RequestContext.getCurrentInstance();
        FacesMessage msg = null;
        boolean bIsLoggedOut = false;

        _loggedOnUser = null;
        _logonCredentials = new LogonCredentials();

        bIsLoggedOut = true;

        msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Bye",
                "Please come back and check our offerings soon!");
View Full Code Here

TOP

Related Classes of de.fhdw.ify208.ticketmaster.webapp.model.UserProfile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.