Merge remote-tracking branch 'thomasb/master'

This commit is contained in:
Andreas Stephanides
2013-07-25 17:01:46 +02:00
16 changed files with 54 additions and 45 deletions

View File

@@ -16,8 +16,7 @@
class Beispiel < ActiveRecord::Base
has_paper_trail
attr_accessible :desc, :name, :file, :lva_id
has_attached_file :file
attr_accessible :desc, :name, :lva_id, :beispieldatei, :beispieldatei_cache
belongs_to :lva
translates :desc, :fallbacks_for_empty_translations => true
mount_uploader :beispieldatei, BeispieldateiUploader
end

View File

@@ -36,19 +36,19 @@ private
##
# Lade Daten aus TISS und füge diese in die Datenbank ein.
def load_tissdata
url= "https://tiss.tuwien.ac.at/api/course/"+ self.lvanr.to_s+"-2012W"
begin
@hash=Hash.from_xml(open(url).read)["tuvienna"]
@person=[]
if @hash["course"]["lecturers"]["oid"].is_a? String
@person = @hash["course"]["lecturers"]["oid"]
else
@hash["course"]["lecturers"]["oid"].each do |pid|
@person << Hash.from_xml(open("https://tiss.tuwien.ac.at/adressbuch/adressbuch/person_via_oid/" + pid.to_s + ".xml").read)["tuvienna"]["person"]
end
end
rescue OpenURI::HTTPError => e
end
url= "https://tiss.tuwien.ac.at/api/course/"+ self.lvanr.to_s+"-2012W"
begin
@hash=Hash.from_xml(open(url).read)["tuvienna"]
@person=[]
if @hash["course"]["lecturers"]["oid"].is_a? String
@person = @hash["course"]["lecturers"]["oid"]
else
@hash["course"]["lecturers"]["oid"].each do |pid|
@person << Hash.from_xml(open("https://tiss.tuwien.ac.at/adressbuch/adressbuch/person_via_oid/" + pid.to_s + ".xml").read)["tuvienna"]["person"]
end
end
rescue OpenURI::HTTPError => e
end
end

View File

@@ -1,4 +1,4 @@
# -*- coding: undecided -*-
# -*- coding: utf-8 -*-
# == Schema Information
#
# Table name: moduls