easy_data 0.0.95 → 0.0.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -105,6 +105,20 @@ class EasyDatasController < ActionController::Base
|
|
105
105
|
def faq
|
106
106
|
end
|
107
107
|
|
108
|
+
# Access to list of model of Data Model
|
109
|
+
def models
|
110
|
+
@xml = Builder::XmlMarkup.new
|
111
|
+
rdf = ModelRdf.new
|
112
|
+
@list = rdf.get_not_hidden_models
|
113
|
+
@host="http://"+request.env["SERVER_NAME"]
|
114
|
+
|
115
|
+
respond_to do |format|
|
116
|
+
format.html
|
117
|
+
format.xml # render :template => "/rdf/request.xml.builder"
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
|
108
122
|
def custom_rdf
|
109
123
|
@models = DataModels.load_models
|
110
124
|
@settings ||= YAML::load(File.open("#{RAILS_ROOT}/config/easy_data/setting.yaml"))
|
@@ -30,7 +30,7 @@ class ModelRdf
|
|
30
30
|
# @return [Hash] return RDF information about public access information of publicated models
|
31
31
|
def get_public_models
|
32
32
|
models = []
|
33
|
-
|
33
|
+
DataModels.load_models.each do |mod|
|
34
34
|
if self.public?(mod)
|
35
35
|
models << mod
|
36
36
|
end
|
@@ -41,7 +41,7 @@ class ModelRdf
|
|
41
41
|
# @return [Hash] return RDF information about not hidden rdf information's models.
|
42
42
|
def get_not_hidden_models
|
43
43
|
models = []
|
44
|
-
|
44
|
+
DataModels.load_models.each do |mod|
|
45
45
|
unless self.hidden?(mod)
|
46
46
|
models << mod
|
47
47
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
xml.instruct! :xml, :version => "1.0", :encoding => "UTF-8"
|
2
|
+
xml.rdf :RDF, {"xmlns:rdf"=>"http://www.w3.org/1999/02/22-rdf-syntax-ns#"} do
|
3
|
+
unless @list.empty?
|
4
|
+
xml.list_model do
|
5
|
+
@list.each do |model|
|
6
|
+
xml.model '',{:url => @host+'/s/'+model.pluralize,:model_name => model.pluralize}
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
data/lib/easy_data/version.rb
CHANGED
data/lib/routes.rb
CHANGED
@@ -14,10 +14,12 @@ module EasyDataRouting
|
|
14
14
|
ed_views.connect 'easy_datas/linked_data', :action => 'linked_data'
|
15
15
|
ed_views.connect 'easy_datas/access_to_data', :action => 'access_to_data'
|
16
16
|
ed_views.connect 'easy_datas/faq', :action => 'faq'
|
17
|
+
|
18
|
+
ed_views.connect 's/models', :action => 'models', :format => 'xml'
|
17
19
|
|
18
20
|
ed_views.connect 'easy_datas/logout', :action => 'logout'
|
19
21
|
DataModels.load_models.each do |model|
|
20
|
-
ed_views.connect "s/#{model.gsub("::","_")}", :controller => "easy_datas",
|
22
|
+
ed_views.connect "s/#{model.gsub("::","_")}/:id", :controller => "easy_datas",
|
21
23
|
:action => 'show',
|
22
24
|
:model => model,
|
23
25
|
:format => 'xml'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 223
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 96
|
10
|
+
version: 0.0.96
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- jnillo
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-12-02 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- lib/easy_data/templates/easy_datas/authenticate_user.html.erb
|
129
129
|
- lib/easy_data/templates/easy_datas/custom_rdf.html.erb
|
130
130
|
- lib/easy_data/templates/easy_datas/info_easy_data.html.erb
|
131
|
+
- lib/easy_data/templates/easy_datas/models.xml.builder
|
131
132
|
- lib/easy_data/templates/easy_datas/show.html.erb
|
132
133
|
- lib/easy_data/templates/easy_datas/show.xml.builder
|
133
134
|
- lib/easy_data/templates/easy_datas/show_all.html.erb
|