Package org.zkybase.model

Examples of org.zkybase.model.Application


    return addNavigation(model, "applicationScmCommits");
  }
 
  @RequestMapping(value = "/{id}/scm/downloads", method = RequestMethod.GET)
  public String getDownloads(@PathVariable Long id, Model model) {
    Application app = applicationService.findOne(id);
   
    // FIXME Currently assuming GitHub.
    GitHubScm scm = (GitHubScm) app.getScm();
    List<GitHubDownload> downloads = gitHub.repoOperations().getDownloads(scm.getUser(), scm.getRepo());
   
    model.addAttribute(app);
    model.addAttribute("entity", app);
    model.addAttribute("downloadList", downloads);
View Full Code Here


   * @param model
   * @return
   */
  @RequestMapping(value = "/{id}/scm/watchers", method = RequestMethod.GET)
  public String getWatchers(@PathVariable Long id, Model model) {
    Application app = applicationService.findOne(id);
   
    // FIXME Currently assuming GitHub.
    GitHubScm scm = (GitHubScm) app.getScm();
    String user = scm.getUser();
    String repo = scm.getRepo();
    List<GitHubUser> watchers = gitHub.repoOperations().getWatchers(user, repo);
    List<List<GitHubUser>> watcherRows = ViewUtil.toRows(watchers, 3);
   
View Full Code Here

   * @param model
   * @return
   */
  @RequestMapping(value = "/{id}/scm/hooks", method = RequestMethod.GET)
  public String getHooks(@PathVariable Long id, Model model) {
    Application app = applicationService.findOne(id);
   
    // FIXME Currently assuming GitHub.
    GitHubScm scm = (GitHubScm) app.getScm();
    String user = scm.getUser();
    String repo = scm.getRepo();
    List<GitHubHook> hooks = applicationService.findHooks(user, repo);
   
    model.addAttribute(app);
View Full Code Here

   * @param model
   * @return
   */
  @RequestMapping(value = "/{id}/teams", method = RequestMethod.GET)
  public String getTeams(@PathVariable Long id, Model model) {
    Application app = applicationService.findOneWithTeams(id);
    model.addAttribute(app);

    List<ApplicationTeam> appTeams = CollectionsUtil.asList(app.getTeams());
    Collections.sort(appTeams, comparator);
    model.addAttribute(appTeams);
   
    return addNavigation(model, "applicationTeamList");
  }
View Full Code Here

   * Returns the application, with modules loaded.
   */
  @Override
  public Application findOne(Long id) {
    notNull(id);
    Application app = applicationRepository.findOne(id);
   
    // Clear out the modules so they don't appear in the web service call.
    app.setModules(null);
   
    return app;
  }
View Full Code Here

   * @see org.zkybase.service.ApplicationService#findOneWithModules(java.lang.Long)
   */
  @Override
  public Application findOneWithModules(Long id) {
    notNull(id);
    Application app = applicationRepository.findOne(id);
   
    // For now this is how you do it.
    // http://stackoverflow.com/questions/8218864/fetch-annotation-in-sdg-2-0-fetching-strategy-questions
    // http://springinpractice.com/2011/12/28/initializing-lazy-loaded-collections-with-spring-data-neo4j/
    template.fetch(app.getModules());
   
    return app;
  }
View Full Code Here

   * @see org.zkybase.service.ApplicationService#findOneWithTeams(java.lang.Long)
   */
  @Override
  public Application findOneWithTeams(Long id) {
    notNull(id);
    Application app = applicationRepository.findOne(id);
    Iterable<ApplicationTeam> appTeams = app.getTeams();
    for (ApplicationTeam appTeam : appTeams) {
      template.fetch(appTeam.getTeam());
    }
    return app;
  }
View Full Code Here

  @Override
  public Application findOneWithScm(Long id) {
    notNull(id);
   
    // Main data comes from app repo
    Application app = applicationRepository.findOne(id);
    GitHubScm scm = app.getScm();
   
    // Supporting data comes from GitHub
    // FIXME This web service call shouldn't be part of the transaction
    GitHubRepo repo = gitHub().repoOperations().getRepo(scm.getUser(), scm.getRepo());
    scm.setId(repo.getId());
View Full Code Here

   * @see org.zkybase.service.ApplicationService#addModule
   * (java.lang.Long, org.zkybase.model.Module, org.springframework.validation.Errors)
   */
  @Override
  public void addModule(Long id, Module module, Errors errors) {
    Application app = findOneWithModules(id);
    app.getModules().add(module);
    update(app, errors);
  }
View Full Code Here

TOP

Related Classes of org.zkybase.model.Application

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.