1 class PublicationsController < ApplicationController
4 # before_filter :authorize, :only => [:issues]
7 @publications = Publication.all
10 format.xml { render :xml => @publications }
11 format.json { render :json => @publications }
18 regexp = Regexp.new(Setting.plugin_redmine_publications[:pattern])
19 Repository.all.each do |repo|
21 repo.entries.each do |entry|
22 match = entry.path.match(regexp)
24 Publication.find_or_create_by_name(:name => match[1],
25 :source_file => entry.path, :repository_id => repo.id)
26 repo_status += [{:path => entry.path, :match => match[1], :matched => true}]
28 repo_status += [{:path => entry.path, :match =>nil, :matched => false}]
31 @match_status += [{:repo => repo, :status => repo_status}]
34 respond_to do |format|
36 format.xml { render :xml => @match_status}
37 format.json { render :json => @match_status }
42 @publication = Publication.find_by_name(params[:pub])
44 joins = "JOIN issue_publications ON (issues.id = issue_publications.issue_id)"
45 conditions = ['issue_publications.publication_id = ? ', @publication.id ]
46 @issues = Issue.all(:joins => joins, :conditions => conditions)
47 respond_to do |format|
50 render :xml => @issues
54 headers['Content-Type'] = 'application/json'
55 render :json => @issues
60 def redirect_to_platform
67 @project = Project.find(params[:project_id])