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|
20 repo.entries.each do |entry|
21 match = entry.path.match(regexp)
23 Publication.find_or_create_by_name(:name => match[1],
24 :source_file => entry.path, :repository_id => repo.id)
25 @match_status += [{:path => entry.path, :match => match[1], :matched => true}]
27 @match_status += [{:path => entry.path, :match =>nil, :matched => false}]
32 respond_to do |format|
34 format.xml { render :xml => @publications }
35 format.json { render :json => @publications }
40 @publication = Publication.find_by_name(params[:pub])
42 joins = "JOIN issue_publications ON (issues.id = issue_publications.issue_id)"
43 conditions = ['issue_publications.publication_id = ? ', @publication.id ]
44 @issues = Issue.all(:joins => joins, :conditions => conditions)
45 respond_to do |format|
48 render :xml => @issues
52 headers['Content-Type'] = 'application/json'
53 render :json => @issues
58 def redirect_to_platform
65 @project = Project.find(params[:project_id])