Android Open Source - swazam Home Controller






From Project

Back to project page swazam.

License

The source code is released under:

MIT License

If you think the Android project swazam listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package ac.tuwien.sa13.controller;
//from  w w w .  j  a va2 s  .com
import java.io.IOException;
import java.util.List;
import java.util.Locale;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.RequestBody;
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.bind.annotation.ResponseBody;

import ac.tuwien.sa13.entity.Request;
import ac.tuwien.sa13.entity.Transaction;
import ac.tuwien.sa13.entity.User;
import ac.tuwien.sa13.service.IRequestService;
import ac.tuwien.sa13.service.ITransactionService;
import ac.tuwien.sa13.service.IUserService;
import ac.tuwien.sa13.service.PeerManager;

/**
 * Handles requests for the application home page.
 */
@Controller
public class HomeController {
  
  private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
  
  @Autowired
  private IUserService userService;
  
  @Autowired
  private IRequestService requestService;
  
  @Autowired
  private ITransactionService transactionService;
  
  
  @RequestMapping(value = "/", method = RequestMethod.GET)
  public String home(Locale locale, Model model) throws IOException {
    
    PeerManager peerManager = PeerManager.getInstance();
    return "home";  
  }
  
  @RequestMapping(value = "/test_user_request", method = RequestMethod.GET)
  public String test_user_request(Locale locale, Model model) throws IOException {
    
    User user = new User();
    user.setName("admin");
    user.setPassword("password");
    
    Request req1 = new Request();
    req1.setFingerprint("adsf");
    req1.setUser(user);
    Request req2 = new Request();
    req2.setFingerprint("asdfasdfafsd");
    req2.setUser(user);
    
    userService.add(user);
    requestService.add(req1);
    requestService.add(req2);
    
    User userFromDB = userService.getUser("admin");
    List<Request> requestsFromDB = requestService.getRequests(user);
    
    System.out.println(userFromDB.getPassword());
    System.out.println(requestsFromDB.get(0).getUser().getId());
    //System.out.println("ENDE" + user.toString() + requestsFromDB.get(0).toString());
//    
//        
    return "home";  
  }
  
  @RequestMapping("resttesting")
    @ResponseBody
    public User restTest() {
     
     User u = userService.getUser("max");
     return u;
    }
}




Java Source Code List

ac.tuwien.sa13.beans.HibernateAwareObjectMapper.java
ac.tuwien.sa13.controller.HomeController.java
ac.tuwien.sa13.controller.LoginController.java
ac.tuwien.sa13.controller.RequestController.java
ac.tuwien.sa13.controller.TransactionController.java
ac.tuwien.sa13.controller.api.UserRestController.java
ac.tuwien.sa13.dao.HibernateDAO.java
ac.tuwien.sa13.dao.IGenericDAO.java
ac.tuwien.sa13.dao.IRequestDAO.java
ac.tuwien.sa13.dao.ITransactionDAO.java
ac.tuwien.sa13.dao.IUserDAO.java
ac.tuwien.sa13.dao.RequestDAO.java
ac.tuwien.sa13.dao.TransactionDAO.java
ac.tuwien.sa13.dao.UserDAO.java
ac.tuwien.sa13.entity.Request.java
ac.tuwien.sa13.entity.Transaction.java
ac.tuwien.sa13.entity.User.java
ac.tuwien.sa13.service.IGenericService.java
ac.tuwien.sa13.service.IRequestService.java
ac.tuwien.sa13.service.ITransactionService.java
ac.tuwien.sa13.service.IUserService.java
ac.tuwien.sa13.service.PeerManager.java
ac.tuwien.sa13.service.RequestService.java
ac.tuwien.sa13.service.TransactionService.java
ac.tuwien.sa13.service.UserService.java
ac.tuwien.sa13.utilities.SessionIdentifierGenerator.java
ac.tuwien.sa13.utilities.Token.java
ac.tuwien.sa13.validator.LoginValidator.java
at.ac.tuwien.swa13.swazam.NetworkConnection.java
at.ac.tuwien.swa13.swazam.Peer.java
at.ac.tuwien.swa13.swazam.fingerprint.IFingerPrintCreator.java
at.ac.tuwien.swa13.swazam.fingerprint.impl.FingerPrintCreator.java
at.ac.tuwien.swa13.swazam.library.ILibraryManager.java
at.ac.tuwien.swa13.swazam.library.ISong.java
at.ac.tuwien.swa13.swazam.library.impl.LibraryManager.java
at.ac.tuwien.swa13.swazam.library.impl.Song.java
at.ac.tuwien.swa13.swazam.p2p.PeerConnector.java
at.saws2013.szazam.App.java
at.saws2013.szazam.BaseActivity.java
at.saws2013.szazam.HistoryActivity.java
at.saws2013.szazam.LoginActivity.java
at.saws2013.szazam.RecognitionActivity.java
at.saws2013.szazam.SettingsActivity.java
at.saws2013.szazam.entities.IListItem.java
at.saws2013.szazam.entities.ListItemTypes.java
at.saws2013.szazam.entities.Request.java
at.saws2013.szazam.entities.Transaction.java
at.saws2013.szazam.fingerprint.IFingerPrintSystem.java
at.saws2013.szazam.fingerprint.impl.FingerPrintCreator.java
at.saws2013.szazam.fragments.SettingsFragment.java
at.saws2013.szazam.media.IAudioFilePicker.java
at.saws2013.szazam.media.IAudioRecorder.java
at.saws2013.szazam.media.impl.AudioFilePicker.java
at.saws2013.szazam.media.impl.AudioRecorder.java
at.saws2013.szazam.store.IAuthStore.java
at.saws2013.szazam.store.IRequestStore.java
at.saws2013.szazam.store.ITransactionStore.java
at.saws2013.szazam.store.impl.AuthStore.java
at.saws2013.szazam.store.impl.RequestStore.java
at.saws2013.szazam.store.impl.TransactionStore.java
at.saws2013.szazam.ui.CustomListAdapter.java
at.saws2013.szazam.ui.ViewTools.java
at.saws2013.szazam.volley.CustomVolleyStringRequest.java
de.passsy.holocircularprogressbar.HoloCircularProgressBar.java