easy_data3 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. data/.gitignore +9 -0
  2. data/.idea/EasyData.iml +11 -0
  3. data/.idea/encodings.xml +5 -0
  4. data/.idea/misc.xml +11 -0
  5. data/.idea/modules.xml +9 -0
  6. data/.idea/vcs.xml +7 -0
  7. data/Gemfile +6 -0
  8. data/README.md +44 -0
  9. data/Rakefile +12 -0
  10. data/bin/linked_data +5 -0
  11. data/easy_data.gemspec +28 -0
  12. data/lib/controllers/easy_datas_controller.rb +340 -0
  13. data/lib/data_models/RDFa.rb +100 -0
  14. data/lib/data_models/data_models.rb +74 -0
  15. data/lib/data_models/linked_data_graph.rb +80 -0
  16. data/lib/data_models/model_rdf.rb +344 -0
  17. data/lib/data_models/namespaces/cc.rb +36 -0
  18. data/lib/data_models/namespaces/cert.rb +33 -0
  19. data/lib/data_models/namespaces/dc.rb +87 -0
  20. data/lib/data_models/namespaces/dc11.rb +47 -0
  21. data/lib/data_models/namespaces/doap.rb +68 -0
  22. data/lib/data_models/namespaces/exif.rb +192 -0
  23. data/lib/data_models/namespaces/foaf.rb +93 -0
  24. data/lib/data_models/namespaces/geo.rb +35 -0
  25. data/lib/data_models/namespaces/http.rb +50 -0
  26. data/lib/data_models/namespaces/owl.rb +83 -0
  27. data/lib/data_models/namespaces/rdfs.rb +41 -0
  28. data/lib/data_models/namespaces/rsa.rb +35 -0
  29. data/lib/data_models/namespaces/rss.rb +38 -0
  30. data/lib/data_models/namespaces/sioc.rb +110 -0
  31. data/lib/data_models/namespaces/skos.rb +61 -0
  32. data/lib/data_models/namespaces/wot.rb +45 -0
  33. data/lib/data_models/namespaces/xhtml.rb +32 -0
  34. data/lib/data_models/namespaces/xsd.rb +77 -0
  35. data/lib/data_models/namespaces.rb +28 -0
  36. data/lib/easy_data/tasks.rb +137 -0
  37. data/lib/easy_data/templates/easy_datas/_data_publications.html.erb +28 -0
  38. data/lib/easy_data/templates/easy_datas/_footer.html.erb +5 -0
  39. data/lib/easy_data/templates/easy_datas/_linked_data_model.html.erb +19 -0
  40. data/lib/easy_data/templates/easy_datas/_linked_datas.html.erb +19 -0
  41. data/lib/easy_data/templates/easy_datas/_list_model_info.html.erb +23 -0
  42. data/lib/easy_data/templates/easy_datas/_list_properties.html.erb +24 -0
  43. data/lib/easy_data/templates/easy_datas/_list_properties_edit.html.erb +35 -0
  44. data/lib/easy_data/templates/easy_datas/_menu.html.erb +24 -0
  45. data/lib/easy_data/templates/easy_datas/_menu_custom.html.erb +18 -0
  46. data/lib/easy_data/templates/easy_datas/_model_attributes.html.erb +45 -0
  47. data/lib/easy_data/templates/easy_datas/_model_attributes_edit.html.erb +17 -0
  48. data/lib/easy_data/templates/easy_datas/_model_attributes_info.html.erb +24 -0
  49. data/lib/easy_data/templates/easy_datas/_settings.html.erb +33 -0
  50. data/lib/easy_data/templates/easy_datas/authenticate_user.html.erb +20 -0
  51. data/lib/easy_data/templates/easy_datas/custom_rdf.html.erb +28 -0
  52. data/lib/easy_data/templates/easy_datas/info_easy_data.html.erb +7 -0
  53. data/lib/easy_data/templates/easy_datas/show.html.erb +1 -0
  54. data/lib/easy_data/templates/easy_datas/show.xml.builder +18 -0
  55. data/lib/easy_data/templates/easy_datas/show_all.html.erb +1 -0
  56. data/lib/easy_data/templates/easy_datas/show_all.xml.builder +16 -0
  57. data/lib/easy_data/templates/easy_datas/view_settings.html.erb +32 -0
  58. data/lib/easy_data/templates/images/LogoEasyData.jpg +0 -0
  59. data/lib/easy_data/templates/images/bg_ft.png +0 -0
  60. data/lib/easy_data/templates/images/bg_link.jpg +0 -0
  61. data/lib/easy_data/templates/images/easy_data_logo.png +0 -0
  62. data/lib/easy_data/templates/images/lock.png +0 -0
  63. data/lib/easy_data/templates/images/loginBt.png +0 -0
  64. data/lib/easy_data/templates/images/login_bg.png +0 -0
  65. data/lib/easy_data/templates/images/logo_ft.png +0 -0
  66. data/lib/easy_data/templates/images/powerby.jpg +0 -0
  67. data/lib/easy_data/templates/images/rdf_icon.png +0 -0
  68. data/lib/easy_data/templates/images/rdf_icon_s.png +0 -0
  69. data/lib/easy_data/templates/images/shadow_menu.png +0 -0
  70. data/lib/easy_data/templates/layouts/easy_data_layout.html.erb +18 -0
  71. data/lib/easy_data/templates/rdf/request.xml.builder +1 -0
  72. data/lib/easy_data/templates/rdf/show.builder +1 -0
  73. data/lib/easy_data/templates/stylesheets/easy_data_style.css +62 -0
  74. data/lib/easy_data/version.rb +3 -0
  75. data/lib/easy_data.rb +107 -0
  76. data/lib/routes.rb +41 -0
  77. data/lib/tasks/testing_installation.rb +6 -0
  78. data/test/data_models_test.rb +11 -0
  79. data/test/rdfa_test.rb +18 -0
  80. data/test/unit/RDFa_test.rb +1 -0
  81. data/test/unit/data_models_test.rb +10 -0
  82. data/test/unit/linked_data_graph_test.rb +1 -0
  83. data/test/unit/model_rdf_test.rb +1 -0
  84. data/test/unit/namespaces_test.rb +2 -0
  85. metadata +172 -0
@@ -0,0 +1,61 @@
1
+ module EasyData
2
+ module RDF
3
+ class SKOS < Namespaces
4
+
5
+ @@uri = "http://www.w3.org/2004/02/skos/core#"
6
+
7
+ @@properties= {"altLabel" => "",
8
+ "broadMatch" => "",
9
+ "broader" => "",
10
+ "broaderTransitive" => "",
11
+ "changeNote" => "",
12
+ "closeMatch" => "",
13
+ "definition" => "",
14
+ "editorialNote" => "",
15
+ "exactMatch" => "",
16
+ "example" => "",
17
+ "hasTopConcept" => "",
18
+ "hiddenLabel" => "",
19
+ "historyNote" => "",
20
+ "inScheme" => "",
21
+ "mappingRelation" => "",
22
+ "member" => "",
23
+ "memberList" => "",
24
+ "narrowMatch" => "",
25
+ "narrower" => "",
26
+ "narrowerTransitive" => "",
27
+ "notation" => "",
28
+ "note" => "",
29
+ "prefLabel" => "",
30
+ "related" => "",
31
+ "relatedMatch" => "",
32
+ "scopeNote" => "",
33
+ "semanticRelation" => "",
34
+ "topConceptOf" => ""
35
+ }
36
+
37
+ # Return Namespace URI
38
+ def self.get_uri
39
+ @@uri
40
+ end
41
+
42
+ # Return tag to rdf doc
43
+ def self.to_s(property,uri,value)
44
+ @@properties[property].gsub("%uri%",uri).gsub('%value%',value)
45
+ end
46
+
47
+ #Return a list of Namespace's properties
48
+ def self.properties
49
+ @@properties.keys
50
+ end
51
+
52
+ def self.properties_form
53
+ list = {}
54
+ @@properties.keys.each do |property|
55
+ list[property] = property
56
+ end
57
+ list
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,45 @@
1
+ module EasyData
2
+ module RDF
3
+ class WOT < Namespaces
4
+
5
+ @@uri = "http://www.xmlns.com/wot/0.1/"
6
+ @@properties= {"assurance" => "",
7
+ "encryptedTo" => "",
8
+ "encrypter" => "",
9
+ "fingerprint" => "",
10
+ "hasKey" => "",
11
+ "hex_id" => "",
12
+ "identity" => "",
13
+ "length" => "",
14
+ "pubkeyAddress" => "",
15
+ "sigdate" => "",
16
+ "signed" => "",
17
+ "signer" => "",
18
+ "sigtime" => ""
19
+ }
20
+
21
+ # Return Namespace URI
22
+ def self.get_uri
23
+ @@uri
24
+ end
25
+
26
+ # Return tag to rdf doc
27
+ def self.to_s(property,uri,value)
28
+ @@properties[property].gsub("%uri%",uri).gsub('%value%',value)
29
+ end
30
+
31
+ #Return a list of Namespace's properties
32
+ def self.properties
33
+ @@properties.keys
34
+ end
35
+
36
+ def self.properties_form
37
+ list = {}
38
+ @@properties.keys.each do |property|
39
+ list[property] = property
40
+ end
41
+ list
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,32 @@
1
+ module EasyData
2
+ module RDF
3
+ class XHTML < Namespaces
4
+ @@uri = "http://www.w3.org/1999/xhtml/vocab#"
5
+ @@properties= {
6
+ }
7
+
8
+ # Return Namespace URI
9
+ def self.get_uri
10
+ @@uri
11
+ end
12
+
13
+ # Return tag to rdf doc
14
+ def self.to_s(property,uri,value)
15
+ @@properties[property].gsub("%uri%",uri).gsub('%value%',value)
16
+ end
17
+
18
+ #Return a list of Namespace's properties
19
+ def self.properties
20
+ @@properties.keys
21
+ end
22
+
23
+ def self.properties_form
24
+ list = {}
25
+ @@properties.keys.each do |property|
26
+ list[property] = property
27
+ end
28
+ list
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,77 @@
1
+ module EasyData
2
+ module RDF
3
+ class XSD < Namespaces
4
+
5
+ @@uri = "http://www.w3.org/2001/XMLSchema#"
6
+
7
+ @@properties= {"NOTATION" => "",
8
+ "QName" => "",
9
+ "anyURI" => "",
10
+ "base64Binary" => "",
11
+ "boolean" => "",
12
+ "date" => "",
13
+ "dateTime" => "",
14
+ "decimal" => "",
15
+ "double" => "",
16
+ "duration" => "",
17
+ "float" => "",
18
+ "gDay" => "",
19
+ "gMonth" => "",
20
+ "gMonthDay" => "",
21
+ "gYear" => "",
22
+ "gYearMonth" => "",
23
+ "hexBinary" => "",
24
+ "string" => "",
25
+ "time" => "",
26
+ "ENTITIES" => "", # XML Schema built-in derived types
27
+ "ENTITY" => "", # @see http://www.w3.org/TR/xmlschema-2/#built-in-derived
28
+ "ID" => "",
29
+ "IDREF" => "",
30
+ "IDREFS" => "",
31
+ "NCName" => "",
32
+ "NMTOKEN" => "",
33
+ "NMTOKENS" => "",
34
+ "Name" => "",
35
+ "byte" => "",
36
+ "int" => "",
37
+ "integer" => "",
38
+ "language" => "",
39
+ "long" => "",
40
+ "negativeInteger" => "",
41
+ "nonNegativeInteger" => "",
42
+ "nonPositiveInteger" => "",
43
+ "normalizedString" => "",
44
+ "positiveInteger" => "",
45
+ "short" => "",
46
+ "token" => "",
47
+ "unsignedByte" => "",
48
+ "unsignedInt" => "",
49
+ "unsignedLong" => "",
50
+ "unsignedShort" => ""
51
+ }
52
+
53
+ # Return Namespace URI
54
+ def self.get_uri
55
+ @@uri
56
+ end
57
+
58
+ # Return tag to rdf doc
59
+ def self.to_s(property,uri,value)
60
+ @@properties[property].gsub("%uri%",uri).gsub('%value%',value)
61
+ end
62
+
63
+ #Return a list of Namespace's properties
64
+ def self.properties
65
+ @@properties.keys
66
+ end
67
+
68
+ def self.properties_form
69
+ list = {}
70
+ @@properties.keys.each do |property|
71
+ list[property] = property
72
+ end
73
+ list
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,28 @@
1
+ module EasyData
2
+ module RDF
3
+ class Namespaces
4
+
5
+ # List of namespace availables to be used in RDF info models
6
+ @@namespaces=['cc','cert','dc','dc11','doap','exif','foaf','geo','http','owl','rdfs','rsa','rss','sioc','skos','wot','xhtml','xsd']
7
+
8
+ # Return List of namespaces
9
+ # @return [Array] list of namespaces
10
+ def self.list
11
+ @@namespaces
12
+ end
13
+
14
+ # Return list of namespaces to be used in a form
15
+ # @return [Hash] hash of namespace
16
+ def self.list_form
17
+ list = {}
18
+
19
+ @@namespaces.each do |namespace|
20
+ list[namespace] = namespace
21
+ end
22
+
23
+ list
24
+ end
25
+
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,137 @@
1
+ #require "ftools"
2
+ require 'rake'
3
+ require 'easy_data'
4
+ require 'active_record'
5
+
6
+
7
+ namespace :easy_data do
8
+
9
+ desc <<-END_DESC
10
+ "This tasks install and initialize parameters for run gem."
11
+ END_DESC
12
+ task :install => [:generate_info_initialize,:generate_info_rdf,:copy_style_interface,:build_linked_data_graph] do
13
+ puts "*** Finish install Easy Data gem in this proyect ***"
14
+ end
15
+
16
+ desc <<-END_DESC
17
+ "Generate info initialize gem"
18
+ END_DESC
19
+ task :generate_info_initialize => :environment do
20
+
21
+ easy_data_initialize_dir = "#{RAILS_ROOT}/config/initializers"
22
+
23
+ file = File.open("#{easy_data_initialize_dir}/load_easy_data.rb","w")
24
+
25
+ puts "Generating info initialize gem"
26
+
27
+ file.puts "#Load templates paths:"
28
+ file.puts "require 'easy_data'"
29
+ file.puts "ActionController::Base.view_paths << EasyData.get_view_path"
30
+
31
+
32
+ file.close
33
+ end
34
+
35
+ desc <<-END_DESC
36
+ "Generating yml file with asociate info rdf to model's attributes"
37
+ END_DESC
38
+ task :generate_info_rdf => :environment do
39
+
40
+ puts "Generating RDF informations "
41
+
42
+ models = DataModels.load_models
43
+
44
+ easy_data_dir = "#{RAILS_ROOT}/config/easy_data"
45
+
46
+ unless File.exist? easy_data_dir
47
+ Dir.mkdir easy_data_dir
48
+ end
49
+
50
+ file = File.open("#{easy_data_dir}/rdf_info.yaml","w")
51
+ rdf_info = {}
52
+
53
+ file.puts "#This is a document about RDF descriptions"
54
+
55
+ models.each do |model|
56
+
57
+ model_data = DataModels.get_model_data(model)
58
+
59
+ if model_data.respond_to?:columns
60
+
61
+ rdf_info[model] = EasyData.yaml_description_model(model_data)
62
+
63
+ end
64
+
65
+ end
66
+
67
+ file.puts rdf_info.to_yaml
68
+
69
+
70
+ file.close
71
+
72
+ puts "Rdf Information Model, was generated in #{easy_data_dir}/rdf_info.yaml"
73
+
74
+ end
75
+
76
+ desc <<-END_DESC
77
+ "Copy style for custom rdf interface"
78
+ END_DESC
79
+ task :copy_style_interface => :environment do
80
+
81
+ file_style = EasyData.get_style_path
82
+ #Copy file to public/stylesheets:
83
+ puts "Copy Style File to this proyect"
84
+
85
+ easy_data_stylesheets = "#{RAILS_ROOT}/public/stylesheets/easy_data"
86
+ easy_data_linked_data_graphs = "#{RAILS_ROOT}/public/images/linked_data_graphs"
87
+
88
+ unless File.exist? easy_data_stylesheets
89
+ Dir.mkdir easy_data_stylesheets
90
+ end
91
+
92
+ FileUtils.copy(File.join(File.dirname(__FILE__), 'templates/stylesheets/easy_data_style.css'),"#{easy_data_stylesheets}/easy_data_style.css")
93
+
94
+ FileUtils.cp_r(File.join(File.dirname(__FILE__), 'templates/images/'),"#{easy_data_stylesheets}/")
95
+
96
+ unless File.exist? easy_data_linked_data_graphs
97
+ Dir.mkdir easy_data_linked_data_graphs
98
+ end
99
+
100
+ end
101
+
102
+ desc <<-END_DESC
103
+ "Add admin user to configure Rdf Info"
104
+ END_DESC
105
+ task :add_user,:user,:pass, :needs=> :environment do |t,args|
106
+
107
+ args.with_defaults(:user => "admin", :pass => "admin")
108
+
109
+ easy_data_dir = "#{RAILS_ROOT}/config/easy_data"
110
+
111
+ file = File.open("#{easy_data_dir}/setting.yaml","w")
112
+ file.puts "#User admin:"
113
+
114
+ admin = {"user_admin" =>{"user" => args.user,"pass" => args.pass},
115
+ "project" => {"name" => nil, "contact_email" => nil,"description" => nil},
116
+ "access" => {"ip" => nil}
117
+ }
118
+ file.puts admin.to_yaml
119
+
120
+ file.close
121
+
122
+ puts "User #{args.user} added"
123
+
124
+ end
125
+
126
+ desc <<-END_DESC
127
+ "Build Linked Data Graph"
128
+ END_DESC
129
+
130
+ task :build_linked_data_graph, :needs => :environment do
131
+
132
+ puts "Generating Linked Data graph..."
133
+ EasyData.build_linked_data_graph
134
+ puts "Ok"
135
+ end
136
+
137
+ end
@@ -0,0 +1,28 @@
1
+ <div id="list_models" class="list_model_info">
2
+ <ul>
3
+ <% list.each do |model|%>
4
+ <li>
5
+ <span class="model"><%= link_to_remote model,:url => {:controller => 'easy_datas',
6
+ :action => :model_attributes_info,
7
+ :model => model},
8
+ :update => "info_models"
9
+ %>
10
+ </span>
11
+ </li>
12
+ <%end%>
13
+ </ul>
14
+ </div>
15
+
16
+ <div id="info_models" class="ed_info_models">
17
+
18
+ <span class="title_data_publications">Wellcome to the information system interface of the proyect's RDF</span>
19
+ <p>
20
+ In the left pannel, it's list the application's models which the data have publicated on them to access by URI's. If you click in any of them, you can see the data of theses models. The data are divided in attributes which belong to the data model and describe him, and associations with others data model. This way you have a look of the publicated information which you can query to the application by the RDF interfaces which you can use.
21
+ </p>
22
+ <%if !@settings["project"]["contact_email"].nil?%>
23
+ <p>
24
+ Si tiene alguna duda sobre el funcionamiento o el modo de acceso a los datos publicados y no encuentra soluci&oacute;n aqu&iacute; puede enviarnos un email de consulta a <img href="mailto:<%= @settings["project"]["contact_email"]%>" alt="Email"/>.
25
+ </p>
26
+ <%end%>
27
+
28
+ </div>
@@ -0,0 +1,5 @@
1
+ <div id="easy_data_footer" class="easy_data_footer">
2
+ <a href="https://rubygems.org/gems/easy_data" title="Web Project EasyData">
3
+ <%= image_tag(image_path("/stylesheets/easy_data/images/powerby.jpg"))%>
4
+ </a>
5
+ </div>
@@ -0,0 +1,19 @@
1
+ <div class="title_model">Model <%= @model %></div>
2
+ <div class="linked_data_graphs"><%= image_tag(image_path("linked_data_graphs/linked_data_#{@model}.png"))%></div>
3
+
4
+ <span class="title_data_publications">Access model <%=@model%></span>
5
+
6
+ <span class="simple_data"><a href="<%= @host+'/s/'+@model.camelize.pluralize%>" title="access to <%=@model%>"><%=@host+'/s/'+@model.camelize.pluralize%></a></span><br />
7
+
8
+ <%if @associations.respond_to?:each%>
9
+ <span class="title_data_publications">
10
+ Assocciations access
11
+ </span>
12
+ <ul class="linked_data_assocciations">
13
+ <%@associations.each do |assoc,model|%>
14
+ <li><%=assoc.camelize%> : <a href="<%= @host+'/s/'+model.camelize.pluralize%>" title="access to <%=assoc%>"><%= @host+'/s/'+model.camelize.pluralize%></a></li>
15
+ <%end%>
16
+ </ul>
17
+ <%end%>
18
+
19
+
@@ -0,0 +1,19 @@
1
+ <div id="list_models" class="list_model_info">
2
+ <ul>
3
+ <% @list.each do |model|%>
4
+ <% if File.exists?("public/images/linked_data_graphs/linked_data_#{model}.png")%>
5
+ <li>
6
+ <span class="model"><%= link_to_remote model,:url => {:controller => "easy_datas",
7
+ :action => "load_linked_data_graph",
8
+ :model => model},
9
+ :update => "info_models"
10
+ %>
11
+ </span>
12
+ </li>
13
+ <%end%>
14
+ <%end%>
15
+ </ul>
16
+ </div>
17
+
18
+ <div id="info_models" class="ed_info_models">
19
+ </div>
@@ -0,0 +1,23 @@
1
+ <div id="select_privacy">
2
+ <span>Access privacy: </span>
3
+ <%= select "privacy","#{model_name}", {"Hidden" => "Hidden","Public" => "Public","Privacy" => "Privacy"},{:selected => model[:privacy]}%>
4
+ <span class="rdf_info"><%= "(Current value: #{model[:privacy]})"%></span>
5
+ </div>
6
+
7
+ <br />
8
+
9
+ <div id="<%="select_#{model_name}"%>">
10
+ <span>Rdf Type: </span>
11
+ <%= select "namespace","#{model_name}",namespaces,{:prompt => "Select a namespaces..."} -%>
12
+ <span class="rdf_info"><%= "(Current value: #{model[:namespace]})" %></span>
13
+ </div>
14
+
15
+ <%= observe_field "namespace_#{model_name}",{:url => {:controller => "easy_datas",:action => "load_properties",
16
+ :block=>"properties_#{model_name}",:attribute => model_name,:model => model_name},
17
+ :with => '"id="+value',
18
+ :on => :selected,
19
+ :update => "properties_#{model_name}"}
20
+ %>
21
+ <br/>
22
+ <div id="<%= "properties_#{model_name}"%>">&nbsp;</div>
23
+
@@ -0,0 +1,24 @@
1
+ <div class="attributes_info">
2
+ <%attributes.each do |att,properties|%>
3
+ <div class="property">
4
+ <span class="attribute"><%=att%></span>
5
+ <% unless properties.is_a?(String)%>
6
+ <div id="privacy">
7
+ <span>Access privacy: </span>
8
+ <span><%= properties[:privacy] %></span>
9
+ </div>
10
+ <div id="<%="namespace"%>">
11
+ <span>Rdf Namespace: </span>
12
+ <span><%= properties[:namespace] -%></span>
13
+ </div>
14
+ <div id="<%= "property"%>">
15
+ <span>Property:</span>
16
+ <span><%=properties[:property] %></span>
17
+ </div>
18
+ <%else%>
19
+ <span>This attribute can't be publicate</span>
20
+ <%end%>
21
+ </div>
22
+ <br />
23
+ <%end%>
24
+ </div>
@@ -0,0 +1,35 @@
1
+ <div class="attributes_info">
2
+ <% attributes.each do |att, properties| %>
3
+ <div class="property">
4
+ <span class="attribute"><%= att %></span>
5
+ <br/>
6
+ <% unless properties.is_a?(String) %>
7
+ <div id="select_privacy">
8
+ <span>Access privacy: </span>
9
+ <%= select "privacy", att, {"Hidden" => "Hidden", "Public" => "Public", "Private" => "Private"},{:selected => properties[:privacy]} %>
10
+ <span class="rdf_info"><%= "(Current value: #{properties[:privacy]})" %></span>
11
+ </div>
12
+ <br/>
13
+
14
+ <div id="<%= "select_#{model}_#{att}" %>">
15
+ <span>Rdf Type: </span>
16
+ <%= select "rdf_type_#{type}", att, namespaces, {:prompt => "Select a namespaces..."} -%>
17
+ <span class="rdf_info"><%= "(Current value: #{properties[:namespace]})" %></span>
18
+ </div>
19
+ <%= observe_field "rdf_type_#{type}_#{att}", {:url => {:controller => "easy_datas", :action => "load_properties",
20
+ :block=>"properties_#{att}", :attribute => att, :model => model, :type => type},
21
+ :with => '"id="+value',
22
+ :on => :selected,
23
+ :update => "properties_#{model}_#{att}"}
24
+ %>
25
+ <br/>
26
+
27
+ <div id="<%= "properties_#{model}_#{att}" %>">&nbsp;</div>
28
+ <% else %>
29
+ <span> This attribute can't be publicated</span>
30
+ <% end %>
31
+ </div>
32
+ <br/>
33
+ <% end %>
34
+ </div>
35
+
@@ -0,0 +1,24 @@
1
+ <div class="ed_main_menu">
2
+ <ul>
3
+ <li class="layer_menu"><%= "#{(@settings["project"]["name"] rescue nil)} - "%>Data Publications Information</li>
4
+ <li class="menu_link"><%= link_to "Data Publications",{:controller => "easy_datas",:action => "info_easy_data"},
5
+ {:title => "Data Publications"}
6
+ %>
7
+ </li>
8
+ <li class="menu_link"><%= link_to_remote "Linked Data",:url => {:controller => "easy_datas",:action => "load_linked_data_graph"},
9
+ :update => "information_content",
10
+ :html => {:title => "Linked Data"}
11
+ %>
12
+ </li>
13
+ <!--<li class="menu_link"><%#= link_to_remote "Access to Data", :url => {:controller => "easy_datas", :action => "access_to_data"},
14
+ :update => "information_content",
15
+ :html => {:title => "How to access to data publications?"}
16
+ %>
17
+ </li>
18
+ <li class="menu_link"><%#= link_to_remote "Quiz", :url => {:controller => 'easy_datas',:action => 'faq'},
19
+ :update => "information_content",
20
+ :html => {:title => "Any questions?"}
21
+ %>
22
+ </li>-->
23
+ </ul>
24
+ </div>
@@ -0,0 +1,18 @@
1
+ <div class="ed_main_menu">
2
+ <ul>
3
+ <li class="layer_menu"><%= "#{(@settings["project"]["name"] rescue nil)} - " %>Custom RDF Information</li>
4
+ <li class="menu_link"><%= link_to "Custom Rdf", {:controller => "easy_datas", :action => "custom_rdf"},
5
+ {:title => "Custom RDF information"}
6
+ %>
7
+ </li>
8
+ <li class="menu_link"><%= link_to_remote "Settings", :url => {:controller => "easy_datas", :action => "view_settings"},
9
+ :update => "custom_content",
10
+ :html => {:title => "Project Settings"}
11
+ %>
12
+ </li>
13
+ <li class="menu_link refresh"><%= link_to "Refresh Models", :url => {:controller => "easy_datas", :action => "refresh_information"},
14
+ :html => {:title => "Refresh Models list"}
15
+ %>
16
+ </li>
17
+ </ul>
18
+ </div>
@@ -0,0 +1,45 @@
1
+ <div id="list_attributes" class="model_attributes">
2
+
3
+ <span class="title_model"><%=@model%> Model</span>
4
+
5
+ <%if @model_attributes.respond_to?:each%>
6
+ <!-- ATTRIBUTES -->
7
+
8
+ <span class="title_data_publications">Model</span>
9
+ <div class="attributes_info">
10
+ <div id="privacy">
11
+ <span>Access privacy:</span>
12
+ <span><%= @model_attributes[:privacy] %></span>
13
+ </div>
14
+ <div id="<%="namespace"%>">
15
+ <span><b>Rdf Namespace:</b></span>
16
+ <span><%= @model_attributes[:namespace] -%></span>
17
+ </div>
18
+ <div id="<%= "property"%>">
19
+ <span><b>Property:</b></span>
20
+ <span><%=@model_attributes[:property] %></span>
21
+ </div>
22
+ </div>
23
+ <span class="title_data_publications">Resource Attributes</span>
24
+ <%= render :partial => "list_properties",:locals => {:attributes => @model_attributes["attributes"]} %>
25
+ <span class="title_data_publications">Associations whit others Resources</span>
26
+ <!--ASSOCIATIONS-->
27
+ <%= render :partial => "list_properties",:locals => {:attributes => @model_attributes["associations"]} %>
28
+ <%else%>
29
+ <span>Model no found</span>
30
+ <%end%>
31
+ <span>
32
+ <%= button_to_remote "Edit",:url => {:controller => 'easy_datas',
33
+ :action => :model_attributes_edit,
34
+ :model => @model},
35
+ :update => "model_attributes",
36
+ :success => "Effect.Appear('#{@model}_attributes', { duration: 0.4 });",
37
+ :failure => "alert('Ooops! An error occurred.')"
38
+ %>
39
+ </span>
40
+
41
+ <%= button_to_function "Close","Effect.Fade('model_attributes',{ duration : 0.3});$('ls_#{@model}').className='model';",:class=>"close_list"%>
42
+
43
+ </div>
44
+
45
+
@@ -0,0 +1,17 @@
1
+ <% form_remote_tag :url => {:controller => 'easy_datas', :action => "custom_attributes", :model => @model},
2
+ :update => "list_attributes" do -%>
3
+
4
+ <div id="list_attributes" class="model_attributes">
5
+ <span class="title_data_publications">Model</span>
6
+ <%= render :partial => "list_model_info", :locals => {:model_name => @model, :model=> @model_attributes, :namespaces => @namespaces} %>
7
+ <!-- Attributes -->
8
+
9
+ <span class="title_data_publications">Attributes</span>
10
+ <%= render :partial => "list_properties_edit", :locals => {:attributes => @model_attributes["attributes"], :model => @model, :namespaces => @namespaces, :type => "attributes"} %>
11
+ <!--Associations-->
12
+ <span class="title_data_publications">Associations</span>
13
+ <%= render :partial => "list_properties_edit", :locals => {:attributes => @model_attributes["associations"], :model => @model, :namespaces => @namespaces, :type => "associations"} %>
14
+ <%= submit_tag "Send" %>
15
+ <%= button_to_function "Close", "Effect.Fade('model_attributes',{duration: .3});$('ls_#{@model}').className='model';", :class=>"close_list" %>
16
+ <% end -%>
17
+ </div>