Compare commits

..

10 Commits

Author SHA1 Message Date
e9848ae6b3 Updated new map route
from exceptionhandler/maps/new
to exceptionhandler/new
2013-01-07 10:49:41 -05:00
243b33810b Fixed Deleting Of Maps 2013-01-07 10:48:21 -05:00
b9a084cf16 Fixed Map Uploader 2013-01-07 10:41:29 -05:00
00dad43024 Started updating plugin for redmine 2.0.0 + 2013-01-07 09:24:23 -05:00
49e44b87cb Updated retrace.sh to use /usr/bin/java 2012-07-06 12:37:26 -04:00
redmine
7e223f9212 Only display maps link when logged in
added an if clause to the "Maps" link

closes #38
2012-05-06 01:16:00 -04:00
1c60004c4a Changed the "Delete" links into buttons with confirmation
closes #31
2012-04-30 11:26:01 -04:00
7a0f6e5f27 Added Maps to top menu
The menu link routes users to the Maps#index

closes #28
2012-04-30 10:28:58 -04:00
0efbb785c3 Bumped the version to 0.1.0 2012-04-29 17:14:43 -04:00
cbb37e750b Added a method to delete maps
also split the maps into diffrent pages. all map pages urls are now
prefixed with .../exceptionhandler/maps...

closes #18
2012-04-29 17:10:47 -04:00
8 changed files with 82 additions and 40 deletions

View File

@@ -25,10 +25,7 @@ class MapsController < ApplicationController
before_filter :require_user
def index
if session[:uploadSuccess]
flash.now[:notice] = "File has been uploaded successfully"
session[:uploadSuccess] = false
end
end
def uploadFile
@@ -36,5 +33,24 @@ class MapsController < ApplicationController
session[:uploadSuccess] = post
redirect_to(:back)
end
def deleteMap
map = Map.find_by_map(params[:map])
if map != nil
map.destroy
directory = "public/maps"
File.delete("#{Rails.root}/public/maps/#{params[:map]}")
flash.now[:notice] = "Map deleted successfully"
else
flash.now[:error] = "No Map Found"
end
end
def new
if session[:uploadSuccess]
flash.now[:notice] = "File has been uploaded successfully"
session[:uploadSuccess] = false
end
end
end #EOF

View File

@@ -62,8 +62,4 @@ class Map < ActiveRecord::Base
map.map = sha1.hexdigest
map.save
end
def getMap()
end
end

View File

@@ -0,0 +1,2 @@
<strong>exterminate!</strong>
<%= params[:map] %>

View File

@@ -1,29 +1,10 @@
<h1>Exception Handler Maps</h1>
<br/>
<%= form_tag ({:action => 'uploadFile'}, :multipart => true) %>
<label for="package">Package:</label>
<br/>
<strong>Current Maps:</strong>
<% Map.all.each do |map| %>
<br/>
<input name="package" id="package" type="text" maxlength="5555500" size=50%/>
<br/>
<label for="package">Build:</label>
<br/>
<input name="build" id="build" type="text" maxlength="5555500" size=50%/>
<br/>
<%= form_tag ({:action => 'uploadFile'}, :multipart => true) %>
<p><label for="upload_file">Select File</label> :
<br/>
<%= file_field 'upload', 'datafile' %></p>
<%= submit_tag "Upload" %>
<br/>
<br/>
<strong>Current Maps:</strong>
<% Map.all.each do |map| %>
<br/>
<%= map[:package] %> <%= map[:build] %>
<% end %>
<%= form_tag %>
<div>
<%= map[:package] %> <%= map[:build] %> <%= button_to "Delete", "delete/#{map[:map]}", :confirm => "Are you sure?" %>
</div>
<% end %>

View File

@@ -0,0 +1,16 @@
<h1>Exception Handler Map Uploader</h1>
<%= form_tag({:action => :uploadFile}, :multipart => true) do %>
<label for="package">Package:</label>
<br/>
<input name="package" id="package" type="text" maxlength="5555500" size=50%/>
<br/>
<label for="package">Build:</label>
<br/>
<input name="build" id="build" type="text" maxlength="5555500" size=50%/>
<br/>
<p><label for="upload_file">Select File</label> :
<br/>
<%= file_field 'upload', 'datafile' %></p>
<%= submit_tag "Upload" %>
<% end %>
<%= form_tag %>

View File

@@ -20,8 +20,20 @@
# When a new exception report is recieved, it will be compared to existing bug issues.
# If there is a match, the existing issue will be updated
# if not a new bug issue will be generated.
ActionController::Routing::Routes.draw do |map|
map.connect '/exceptionhandler', :controller => 'exceptionhandler', :action => 'index'
map.connect '/maps', :controller => 'maps', :action => 'index'
map.connect '/uploadFile', :controller => 'maps', :action => 'uploadFile'
if Rails::VERSION::MAJOR >= 3
RedmineApp::Application.routes.draw do
match 'exceptionhandler', :to => 'exceptionhandler#index', :via => [:get, :post]
match '/exceptionhandler/maps', :to => 'maps#index', :via => [:get, :post]
match '/uploadFile', :to => 'maps#uploadFile', :via => :post
match '/exceptionhandler/delete/:map', :to => 'maps#deleteMap', :via => :post
match '/exceptionhandler/new', :to => 'maps#new', :via => [:get, :post]
end
else
ActionController::Routing::Routes.draw do |map|
map.connect '/exceptionhandler', :controller => 'exceptionhandler', :action => 'index'
map.connect '/exceptionhandler/maps', :controller => 'maps', :action => 'index'
map.connect '/uploadFile', :controller => 'maps', :action => 'uploadFile'
map.connect '/exceptionhandler/maps/delete/:map', :controller => 'maps', :action => 'deleteMap'
map.connect '/exceptionhandler/maps/new', :controller => 'maps', :action => 'new'
end
end

21
init.rb
View File

@@ -1,10 +1,29 @@
require 'redmine'
::Rails.logger.info 'Starting Exception Report Handler for Redmine'
if Rails::VERSION::MAJOR >= 3
ActionDispatch::Callbacks.to_prepare do
require_dependency 'issue'
require_dependency 'project'
#require_dependency 'customfield'
require_dependency 'time'
#require_dependency 'issuepriority'
require_dependency 'user'
#require_dependency 'issuestatus'
require_dependency 'tracker'
require_dependency 'tempfile'
require_dependency 'open3'
end
end
Redmine::Plugin.register :redmine_exception_handler do
name 'Redmine Exception Handler plugin'
author 'Rick Barrette <rickbarrette@gmail.com>'
description 'An Exception Report Handler plugin for Redmine <= 1.4.x'
version '0.0.5'
version '0.1.0'
url 'http://example.com/redmine/exceptionhandler'
author_url 'http://rickbarrette.dyndns.org'
menu :top_menu, :maps, { :controller => 'maps', :action => 'index' }, :caption => 'Maps', :before => :help, :if => Proc.new { User.current.logged? }
end

View File

@@ -9,4 +9,4 @@
PROGUARD_HOME=`dirname "$0"`/..
/opt/java/jre/bin/java -jar $PROGUARD_HOME/lib/retrace.jar "$@"
/usr/bin/java -jar $PROGUARD_HOME/lib/retrace.jar "$@"