easy_data 0.0.6 → 0.0.7

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.
Files changed (55) hide show
  1. data/.gitignore +1 -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 +2 -0
  8. data/Rakefile +8 -0
  9. data/easy_data.gemspec +1 -2
  10. data/lib/controllers/easy_datas_controller.rb +86 -47
  11. data/lib/data_models/RDFa.rb +22 -13
  12. data/lib/data_models/data_models.rb +21 -4
  13. data/lib/data_models/model_rdf.rb +152 -28
  14. data/lib/data_models/namespaces.rb +6 -6
  15. data/lib/easy_data/templates/easy_datas/_data_publications.html.erb +8 -12
  16. data/lib/easy_data/templates/easy_datas/_footer.html.erb +3 -1
  17. data/lib/easy_data/templates/easy_datas/_linked_data_model.html.erb +19 -1
  18. data/lib/easy_data/templates/easy_datas/_linked_datas.html.erb +6 -5
  19. data/lib/easy_data/templates/easy_datas/_list_model_info.html.erb +2 -2
  20. data/lib/easy_data/templates/easy_datas/_list_properties.html.erb +2 -2
  21. data/lib/easy_data/templates/easy_datas/_list_properties_edit.html.erb +31 -30
  22. data/lib/easy_data/templates/easy_datas/_menu.html.erb +4 -4
  23. data/lib/easy_data/templates/easy_datas/_menu_custom.html.erb +11 -8
  24. data/lib/easy_data/templates/easy_datas/_model_attributes.html.erb +4 -2
  25. data/lib/easy_data/templates/easy_datas/_model_attributes_edit.html.erb +14 -13
  26. data/lib/easy_data/templates/easy_datas/_model_attributes_info.html.erb +16 -9
  27. data/lib/easy_data/templates/easy_datas/_settings.html.erb +7 -4
  28. data/lib/easy_data/templates/easy_datas/authenticate_user.html.erb +9 -3
  29. data/lib/easy_data/templates/easy_datas/custom_rdf.html.erb +7 -5
  30. data/lib/easy_data/templates/easy_datas/show.xml.builder +15 -13
  31. data/lib/easy_data/templates/easy_datas/show_all.xml.builder +5 -5
  32. data/lib/easy_data/templates/easy_datas/view_settings.html.erb +4 -1
  33. data/lib/easy_data/templates/images/LogoEasyData.jpg +0 -0
  34. data/lib/easy_data/templates/images/lock.png +0 -0
  35. data/lib/easy_data/templates/images/loginBt.png +0 -0
  36. data/lib/easy_data/templates/images/login_bg.png +0 -0
  37. data/lib/easy_data/templates/images/powerby.jpg +0 -0
  38. data/lib/easy_data/templates/images/rdf_icon.png +0 -0
  39. data/lib/easy_data/templates/images/rdf_icon_s.png +0 -0
  40. data/lib/easy_data/templates/layouts/easy_data_layout.html.erb +3 -2
  41. data/lib/easy_data/templates/stylesheets/easy_data_style.css +39 -23
  42. data/lib/easy_data/version.rb +1 -1
  43. data/lib/easy_data.rb +34 -3
  44. data/lib/routes.rb +5 -9
  45. data/lib/tasks/testing_installation.rb +1 -1
  46. data/test/data_models_test.rb +11 -0
  47. data/test/rdfa_test.rb +18 -0
  48. data/test/unit/RDFa_test.rb +1 -0
  49. data/test/unit/data_models_test.rb +10 -0
  50. data/test/unit/linked_data_graph_test.rb +1 -0
  51. data/test/unit/model_rdf_test.rb +1 -0
  52. data/test/unit/namespaces_test.rb +2 -0
  53. metadata +33 -12
  54. data/lib/easy_data/templates/images/main_menu.jpg +0 -0
  55. data/lib/easy_data/templates/images/rdf_icon.jpeg +0 -0
@@ -1,16 +1,17 @@
1
- <% form_remote_tag :url => {:controller => 'easy_datas',:action => "custom_attributes",:model => @model},
1
+ <% form_remote_tag :url => {:controller => 'easy_datas', :action => "custom_attributes", :model => @model},
2
2
  :update => "list_attributes" do -%>
3
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
- <span class="title_data_publications">Attributes</span>
9
- <%= render :partial => "list_properties_edit",:locals => {:attributes => @model_attributes["attributes"],:model => @model,:namespaces => @namespaces,:type => "attributes"}%>
10
- <!--Associations-->
11
- <span class="title_data_publications">Associations</span>
12
- <%= render :partial => "list_properties_edit",:locals => {:attributes => @model_attributes["associations"],:model => @model,:namespaces => @namespaces,:type => "associations"}%>
13
- <%= submit_tag "Send" %>
14
- <%= link_to_function "[Close]","Effect.Fade('#{@model}_attributes',{duration: .3})",:class=>"close_list"%>
15
- <%end -%>
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 -%>
16
17
  </div>
@@ -1,17 +1,24 @@
1
+ <span class="title_model"><%=@model%> Model</span>
2
+
1
3
  <% if @model_attributes["attributes"]%>
2
- <span class="data_info"> Attributes: </span>
4
+ <span class="title_data_publications"> Attributes </span>
3
5
  <ul>
4
- <%@model_attributes["attributes"].keys.each do |att|%>
5
- <li><%=att%></li>
6
+ <%@model_attributes["attributes"].each do |att,values|%>
7
+ <%if values[:privacy] && values[:privacy]!="Hidden" && values[:property]!="not defined"%>
8
+ <li><span class="<%='lock' if values[:privacy]=="Private"%>" title="<%='Private attribute' if values[:privacy]=="Private"%>"><%=att%></span></li>
9
+ <%end%>
6
10
  <%end%>
7
- </ul>
11
+ </ul>
8
12
  <%end%>
13
+
9
14
  <%if @model_attributes["associations"] %>
10
- <span class="data_info"> Associations: </span>
11
- <ul>
12
- <%@model_attributes["associations"].keys.each do |assoc|%>
13
- <li><%=assoc%></li>
15
+ <span class="title_data_publications"> Associations </span>
16
+ <ul>
17
+ <%@model_attributes["associations"].each do |att,values|%>
18
+ <%if values[:privacy]!="Hidden" && values[:property]!="not defined"%>
19
+ <li><span class="<%='lock' if values[:privacy]=="Private"%>" title="<%='Private association' if values[:privacy]=="Private"%>"><%=att%></span></li>
20
+ <%end%>
14
21
  <%end%>
15
- </ul>
22
+ </ul>
16
23
  <%end%>
17
24
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  <table class="settings_table">
4
4
  <tr>
5
- <th colspan=2>Proyecto</th>
5
+ <th colspan="2"><div class="title_data_publications">Proyecto</div></th>
6
6
  </tr>
7
7
  <tr>
8
8
  <td><span>Project's name(?):</span></td><td><%= text_field "project","project",:value =>@settings["project"]["name"] %></td>
@@ -11,9 +11,12 @@
11
11
  <td><span>Logo(?):</span></td><td><%= select "project","logo",@images,{:selected => @settings["project"]["logo"]||nil,:prompt => "Select logo ..."}%></td>
12
12
  </tr>
13
13
  <tr>
14
- <td><span>Description(?):</span></td><td><%= text_area "project","description","cols" => 80,"rows"=>5,:value=>@settings["project"]["description"]%></td>
14
+ <td><span>Description(?):</span></td><td><%= text_area "project","description","cols" => 45,"rows"=>5,:value=>@settings["project"]["description"]%></td>
15
15
  </tr>
16
- <tr><th colspan="2">Access</th>
16
+ <tr>
17
+ <td><span>Contact email(?):</span></td><td><%= text_field "project","email",:value=>@settings["project"]["contact_email"]%></td>
18
+ </tr>
19
+ <tr><th colspan="2"><div class="title_data_publications">Access</div></th>
17
20
  <tr>
18
21
  <td><span>User:</span></td><td><%= text_field "user_admin","user",:value=>@settings["user_admin"]["user"]%></td>
19
22
  </tr>
@@ -25,6 +28,6 @@
25
28
  </tr>
26
29
  </table>
27
30
 
28
- <%= submit_tag %>
31
+ <%= submit_tag "Send" %>
29
32
 
30
33
  <%end%>
@@ -1,4 +1,6 @@
1
- <div class="authenticate">
1
+ <div class="authenticate">
2
+ <div class="left"></div>
3
+ <div class="middle">
2
4
  <%form_remote_tag :url => {:controller => 'easy_datas',:action => "login"},
3
5
  :update => "content" do -%>
4
6
  <span>
@@ -9,6 +11,10 @@
9
11
  <%= label_tag :password,nil, :class => "lbla_auth"%>
10
12
  <%= password_field_tag ":password",nil%>
11
13
  </span>
12
- <%= submit_tag "Send" %>
13
- <%end%>
14
+ <%= submit_tag "Access" %>
15
+ <input type="button" name="reset_form" value="Cancel" onclick="this.form.reset();">
16
+ <%end%>
17
+ </div>
18
+ <div class="right"></div>
19
+ <div class="bottom"></div>
14
20
  </div>
@@ -2,16 +2,18 @@
2
2
  <%if @models.respond_to?:each%>
3
3
  <div id="custom_content" class="ed_info_content">
4
4
  <div id="list_models" class="list_model_info">
5
+ <span class="title">Models List</span>
5
6
  <ul>
6
7
  <%@models.each do |model|%>
7
8
  <li class="list_model">
8
- <span class="model"><%= link_to_remote model,:url => {:controller => 'easy_datas',
9
+ <span id="ls_<%= model%>" class="model"><%= link_to_remote model,:url => {:controller => 'easy_datas',
9
10
  :action => :model_attributes,
10
11
  :model => model},
11
- :update => "model_attributes",
12
- :success => "Effect.Appear('model_attributes', { duration: 0.4 });",
13
- :failure => "alert('Ooops! An error occurred.')"
14
- %>
12
+ :update => "model_attributes",
13
+ :after => "$('ls_#{model}').className = 'model_active';",
14
+ :success => "Effect.Appear('model_attributes', { duration: 0.4 });",
15
+ :failure => "alert('Ooops! An error occurred.')"
16
+ %>
15
17
  </span>
16
18
 
17
19
  </li>
@@ -1,16 +1,18 @@
1
1
  xml.instruct! :xml, :version => "1.0", :encoding => "UTF-8"
2
-
3
- xml.rdf :RDF, @rdf_model[:header] do
4
- @rdf_model[:body].each do |element,prop|
5
- xml.rdf :Description, {:about => prop["description"]} do
6
- prop["attributes"].each do |att,value|
7
- xml.tag!(att,value)
8
- end
9
- prop["associations"].each do |assoc,value|
10
- value[:id].each do |id|
11
- xml.tag!(assoc,nil,{"rdf:resource"=>"#{@host}/#{value[:model]}?id=#{id}"})
12
- end
13
- end
14
- end
2
+ unless @rdf_model.empty?
3
+ xml.rdf :RDF, @rdf_model[:header] do
4
+ @rdf_model[:body].each do |element,prop|
5
+ xml.rdf :Description, {"rdf:about" => prop["description"]} do
6
+ prop["attributes"].each do |att,value|
7
+ xml.tag!(att,value)
8
+ end
9
+ prop["associations"].each do |assoc,value|
10
+ value[:id].each do |id|
11
+ xml.tag!(assoc,nil,{"rdf:resource"=>"#{@host}/s/#{value[:model]}/#{id}"})
12
+ end
13
+ end
14
+ end
15
+ end
15
16
  end
16
17
  end
18
+
@@ -1,16 +1,16 @@
1
1
  xml.instruct! :xml, :version => "1.0", :encoding => "UTF-8"
2
-
3
- xml.rdf :RDF, @rdf_model[:header] do
4
- @rdf_model[:body].each do |element,prop|
5
- xml.rdf :Description, {:about => prop["description"]} do
2
+ xml.rdf :RDF, @rdf_model[:header] do
3
+ @rdf_model[:body].each do |element,prop|
4
+ xml.rdf :Description, {"rdf:about" => prop["description"]} do
6
5
  prop["attributes"].each do |att,value|
7
6
  xml.tag!(att,value)
8
7
  end
9
8
  prop["associations"].each do |assoc,value|
10
9
  value[:id].each do |id|
11
- xml.tag!(assoc,nil,{"rdf:resource"=>"#{@host}/#{value[:model]}?id=#{id}"})
10
+ xml.tag!(assoc,nil,{"rdf:resource"=>"#{@host}/s/#{value[:model]}/#{id}"})
12
11
  end
13
12
  end
14
13
  end
15
14
  end
15
+
16
16
  end
@@ -12,6 +12,9 @@
12
12
  <tr>
13
13
  <td>Description: <%=@settings["project"]["description"]%></td>
14
14
  </tr>
15
+ <tr>
16
+ <td>Contact Email: <%=@settings["project"]["contact_email"]%></td>
17
+ </tr>
15
18
  <tr><th>Access Data<th></tr>
16
19
  <tr>
17
20
  <td>User: <%=@settings["user_admin"]["user"]%></td>
@@ -24,6 +27,6 @@
24
27
  </tr>
25
28
  </table>
26
29
 
27
- <%= link_to_remote "Edit Settings",:url => {:controller => "easy_datas",:action => "settings"},
30
+ <%= button_to_remote "Edit Settings",:url => {:controller => "easy_datas",:action => "settings"},
28
31
  :update => "custom_content",
29
32
  :html => {:title => "Project Settings"}%>
@@ -10,8 +10,9 @@
10
10
  <body>
11
11
  <div id="content" class="content">
12
12
  <%= yield %>
13
- <div class="push"></div>
13
+ <%if controller.action_name != "authenticate_user"%>
14
+ <%= render :partial => "easy_datas/footer"%>
15
+ <%end%>
14
16
  </div>
15
- <%= render :partial => "easy_datas/footer"%>
16
17
  </body>
17
18
  </html>
@@ -1,11 +1,18 @@
1
- body{width:100%;height:100%;margin:0;padding:0;font-family:helvetica;}
2
- a{text-decoration:none}
3
- .authenticate{background:url("images/easy_data_logo.png")no-repeat 0 0;padding-top:130px;margin:0 auto;width:400px}
4
- .authenticate form{background:#767676;width:375px;color:white;overflow:hidden;padding: 20px 30px}
5
- .authenticate form .lbl_auth{float:left}
6
- .authenticate form input{float:right}
7
- .authenticate form span{width:95%;display:block;overflow:hidden}
8
- ul{list-style:none;width:90%;float:left;margin-top:30px;}
1
+ body{width:100%;height:100%;margin:0;padding:0;font-family:helvetica;background-color:#f7fffe}
2
+ a{text-decoration:none;border:none}
3
+ img{border: 0;}
4
+ .authenticate{background:url("images/LogoEasyData.jpg") no-repeat 0 0;padding-top:250px;padding-left:90px;margin:0 auto;width:560px;overflow:hidden;}
5
+ .authenticate .left{display:block;background:url("images/login_bg.png") no-repeat 0 0;float:left;width:15px;height:130px;margin-left:50px}
6
+ .authenticate .right{display:block;background:url("images/login_bg.png") no-repeat -15px 0;float:left;width:15px;height:130px;}
7
+ .authenticate .middle{background:#487b4c;overflow:hidden;height:130px;width:400px;float:left}
8
+ .authenticate .middle form{width:300px;height:130px;color:white;font-weight:bold;overflow:hidden;padding: 25px}
9
+ .authenticate .middle form .lbl_auth{float:left}
10
+ .authenticate .middle form input{float:right;width:180px}
11
+ .authenticate .middle form input[type="submit"]{float:left !important;margin-left:115px;margin-top:10px;width:90px !important}
12
+ .authenticate .middle form input[type="button"]{float:left !important;margin-left:5px;margin-top:10px;width:90px !important}
13
+ .authenticate .middle form span{width:100%;display:block;overflow:hidden}
14
+ .authenticate .bottom{display:block;height:95px;width:300px;margin-left:115px;float:left;background:url("images/loginBt.png") no-repeat 0 0}
15
+ ul{list-style:none;width:90%;float:left;margin-top:20px;padding-left:0px;}
9
16
  ul div.list_attributes{overflow:hidden;background-color:white;color:black;padding:0 5%;}
10
17
 
11
18
  ul.attributes_info{width:100%;clear:left;padding:0}
@@ -17,30 +24,39 @@ div.attributes_info div.property span.attribute{font-size:1.15em;font-weight:bol
17
24
  /*EASY DATA INFO*/
18
25
  .content{width:100%}
19
26
 
20
- .ed_main_menu{background:url('images/main_menu.jpg') repeat-x 0 0;overflow:hidden;width:100%;margin:0 auto;display:block;}
27
+ .ed_main_menu{background:#487b4c;overflow:hidden;width:100%;margin:0 auto;display:block;}
21
28
  .ed_main_menu ul{color:white !important;;margin:0px;width:100%;padding:0px 20%}
22
29
  .ed_main_menu ul li{float:left;width:10%;text-align:center;padding:10px 0px;}
23
30
  .ed_main_menu ul li.menu_link{width:10% !important}
24
- .ed_main_menu ul li.menu_link a:hover{background:url("images/bg_link.jpg") no-repeat 0 0;padding:10px 0px;cursor:pointer}
31
+ .ed_main_menu ul li.menu_link a:hover{text-decoration:underline;padding:10px 0px;cursor:pointer}
25
32
  .ed_main_menu ul li a{color:white}
26
33
  .ed_main_menu ul li.layer_menu{font-size:14px;width:300px !important;padding:11px 0;font-weight:bold;max-height:26px}
27
34
 
28
35
 
29
- .ed_info_content{background:url('images/shadow_menu.png') repeat-x 0 0 ;margin:0;padding:2% 20%;overflow:hidden;min-height: 100%;height: auto !important;height: 100%;margin: 0 auto -70px;}
30
- .list_model_info{float:left;width:40%;overflow:hidden}
31
- .list_model_info ul li{margin:0;overflow:hidden;color:blue;padding:5px 20px}
36
+ .ed_info_content{background:url('images/shadow_menu.png') repeat-x 0 0 ;margin:0;padding:2% 20% 2% 20%;overflow:hidden;min-height: 100%;height: auto !important;height: 100%;margin: 0 auto -70px;}
37
+ .list_model_info{float:left;width:35%;overflow:hidden;border:1px #808080 solid;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;background-color:#ddbc8f}
38
+ .title{font-size:22px;font-weight:bold;display:block;padding:10px 0 0 20px;color:#808080}
39
+ .list_model_info ul li{margin:0;overflow:hidden;color:#808080;padding:5px 20px}
32
40
  .list_model_info ul li:hover{margin:0;color:blue !important;}
33
- .list_model_info ul li a{color:#085DAD;font-weight:bold}
41
+ .list_model_info ul li a{color:#808080;font-weight:bold}
34
42
  .list_model_info ul li span{float:left}
35
- .list_model_info ul li .model{width:80%;font-size:20px}
36
- .ed_info_content .list_model_info ul li a:hover{background:url("images/bg_link.jpg") no-repeat 0 0;font-weight:bold;}
37
- .ed_info_content .ed_info_models{float:left;width:60%;padding:4% 0;}
38
- .ed_info_content .settings_table{text-align:left;margin-left:5%;margin-bottom:5%;i}
43
+ .list_model_info ul li .model{width:80%;font-size:15px}
44
+ .list_model_info ul li .model:hover{width:80%;font-size:16px;font-weight:bold;background: url('images/rdf_icon_s.png') no-repeat 0 0; padding-left: 13px;}
45
+ .list_model_info ul li .model_active{width:80%;font-size:16px;font-weight:bold;background: url('images/rdf_icon_s.png') no-repeat 0 0; padding-left: 13px;}
46
+ .ed_info_content .list_model_info ul li a:hover{background:#ddbc8f;font-weight:bold;}
47
+ .ed_info_content .ed_info_models{float:left;width:60%;padding:1% 1%;}
48
+ .ed_info_content .settings_table{text-align:left;margin-left:5%;margin-bottom:5%;width:90%}
39
49
  .ed_info_content .settings_table th{padding: 10px 0}
40
- .title_data_publications{color:#085DAD;text-decoration:underline;}
41
- .ed_info_content .ed_info_models .data_info{text-decoration:underline;color:#085DAD;font-size:15px;width:100%;display:block;}
50
+ .ed_info_content ul{margin-left:20px}
51
+ .title_data_publications{color:#808080;font-weight:bold;text-decoration:underline;width:100%;display:block;padding: 5px 0;margin: 20px 0;overflow:hidden;}
52
+ .title_model{background:url("images/rdf_icon.png") no-repeat 0 0;padding-left:40px;margin-bottom:20px;width:100%;display:block;color:#808080;font-weight:bold;font-size:30px}.ed_info_content .ed_info_models .data_info{text-decoration:underline;color:#085DAD;font-size:15px;width:100%;display:block;}
53
+ .linked_data_graphs{margin:50px 0 0 80px;}
54
+ .linked_data_access{border:1px #ccc solid;width:95%;height:auto;overflow:hidden;margin-top:20px}
55
+ .lock{background:url("/images/lock.png") no-repeat top right;padding-right:18px;}
56
+ .simple_data{margin-left:20px;}
42
57
  /*Footer*/
43
58
 
44
- .easy_data_footer,.push{height:70px;}
45
- .easy_data_footer{background:url("images/bg_ft.png") repeat-x 0 0;width:100%;clear:both;}
46
- .easy_data_footer a{margin-left:60%}
59
+ .easy_data_footer,.push{height:100px;bottom:0;display:block}
60
+ .easy_data_footer{width:100%;}
61
+ .easy_data_footer a{margin-left:60%;overflow:hidden}
62
+
@@ -1,3 +1,3 @@
1
1
  module EasyData
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
data/lib/easy_data.rb CHANGED
@@ -6,7 +6,7 @@ require "data_models/model_rdf"
6
6
  require "data_models/linked_data_graph"
7
7
  require "data_models/RDFa"
8
8
  require "routes"
9
- #require 'ftools'
9
+ require 'ftools'
10
10
  require 'ruby-debug'
11
11
 
12
12
 
@@ -63,7 +63,36 @@ module EasyData
63
63
  def self.build_linked_data_graph
64
64
  LinkedDataGraph.build(DataModels.load_models)
65
65
  end
66
-
66
+
67
+
68
+ def self.refresh_information
69
+ rdf = ModelRdf.new
70
+ models = DataModels.load_models
71
+
72
+ unless self.info_update?(models,rdf)
73
+ rdf_models = rdf.get_models.keys
74
+
75
+ #Add the new models to rdf's information file
76
+ models.each do |model|
77
+ unless rdf_models.keys.include? model
78
+ model_data = DataModels.get_model_data(model)
79
+ if model_data.respond_to?:columns
80
+ rdf.add_model(model,EasyData.yaml_description_model(eval model))
81
+ end
82
+ end
83
+ end
84
+
85
+ #Delete the models how they had deleted
86
+ rdf_models.each do |model|
87
+ unless models.include?model
88
+ rdf.delete_model model
89
+ end
90
+ end
91
+
92
+ rdf.save
93
+ end
94
+ end
95
+
67
96
  private
68
97
 
69
98
  def generate_query(model,params)
@@ -71,6 +100,8 @@ module EasyData
71
100
  FROM #{model};"
72
101
  end
73
102
 
74
-
103
+ def self.info_update?(models,rdf)
104
+ ((models | rdf.get_models.keys)-(models & rdf.get_models.keys)).empty?
105
+ end
75
106
  end
76
107
 
data/lib/routes.rb CHANGED
@@ -2,31 +2,30 @@ require "action_controller"
2
2
 
3
3
  module EasyDataRouting
4
4
  def self.routes(map)
5
-
6
5
  map.with_options :controller => 'easy_datas' do |ed_routes|
7
6
  ed_routes.with_options :conditions => {:method => :get} do |ed_views|
8
7
  ed_views.connect 'easy_datas/custom_rdf', :action=> "custom_rdf"
9
8
  ed_views.connect 'easy_data', :action => "custom_rdf"
10
9
  ed_views.connect 'easy_datas/authenticate_user', :action => "authenticate_user"
11
-
12
10
  ed_views.connect 's/data_publications', :action => 'info_easy_data'
13
11
  ed_views.connect 'easy_datas/info_easy_data', :action => 'info_easy_data'
14
12
  ed_views.connect 'easy_datas/linked_data', :action => 'linked_data'
15
13
  ed_views.connect 'easy_datas/access_to_data', :action => 'access_to_data'
16
14
  ed_views.connect 'easy_datas/faq', :action => 'faq'
17
-
18
15
  ed_views.connect 'easy_datas/logout', :action => 'logout'
16
+ ed_views.connect 'easy_datas/refresh_information', :action => "refresh_information"
17
+
19
18
  DataModels.load_models.each do |model|
20
- ed_views.connect "s/#{model.gsub("::","_")}", :controller => "easy_datas",
19
+ ed_views.connect "s/#{model.gsub("::","_")}/:id", :controller => "easy_datas",
21
20
  :action => 'show',
22
21
  :model => model,
23
22
  :format => 'xml'
24
- ed_views.connect "s/#{model.gsub("::","_").pluralize}", :controller => "easy_datas",
23
+ ed_views.connect "s/#{model.gsub("::","_").pluralize}", :controller => "easy_datas",
25
24
  :action => 'show_all',
26
25
  :model => model,
27
26
  :format => 'xml'
28
-
29
27
  end
28
+
30
29
  end
31
30
  ed_routes.with_options :conditions => {:method => :post} do |ed_actions|
32
31
  ed_actions.connect 'easy_datas/model_attributes_info', :action => "model_attributes_info"
@@ -40,9 +39,6 @@ module EasyDataRouting
40
39
  ed_actions.connect 'easy_datas/custom_settings', :action => 'custom_settings'
41
40
  ed_actions.connect 'easy_datas/view_settings', :action => 'view_settings'
42
41
  end
43
-
44
- #Ajax routes:
45
- # map.resources :easy_datas,:member => {:load_properties => :post}
46
42
  end
47
43
  end
48
44
  end
@@ -3,4 +3,4 @@
3
3
  rm easy_data-0.0.*
4
4
  gem build easy_data.gemspec
5
5
  gem uninstall easy_data
6
- gem install ./easy_data-0.0.6.gem
6
+ gem install ./easy_data-*.gem
@@ -0,0 +1,11 @@
1
+ require 'test/unit'
2
+ require 'easy_data'
3
+
4
+ require 'ruby-debug'
5
+
6
+ class DataModelsTest < Test::Unit::TestCase
7
+
8
+ def test_example
9
+ #assert_equal Array,DataModels.load_models.class
10
+ end
11
+ end
data/test/rdfa_test.rb ADDED
@@ -0,0 +1,18 @@
1
+ require 'test/unit'
2
+ require 'easy_data'
3
+
4
+ require 'ruby-debug'
5
+
6
+ class RDFaTest < Test::Unit::TestCase
7
+
8
+ def setup
9
+ @rdfa = RDFa.new
10
+ end
11
+
12
+ def test_a_tag
13
+
14
+ link = @rdfa.a("User",'http://www.google.es','id','class="link"')
15
+ assert_equal String,link.class
16
+ end
17
+
18
+ end
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,10 @@
1
+ require 'test/unit'
2
+ require 'easy_data'
3
+
4
+ class DataModelsTest < Test::Unit::TestCase
5
+
6
+ def test_load_models
7
+ assert_equal 'Array', DataModels.load_models.class.to_s
8
+ end
9
+
10
+ end
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,2 @@
1
+
2
+
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: 19
5
- prerelease: false
4
+ hash: 17
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - jnillo
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-25 00:00:00 +02:00
19
- default_executable:
18
+ date: 2011-09-28 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: hpricot
@@ -61,6 +60,11 @@ extra_rdoc_files: []
61
60
 
62
61
  files:
63
62
  - .gitignore
63
+ - .idea/EasyData.iml
64
+ - .idea/encodings.xml
65
+ - .idea/misc.xml
66
+ - .idea/modules.xml
67
+ - .idea/vcs.xml
64
68
  - Gemfile
65
69
  - README
66
70
  - Rakefile
@@ -113,12 +117,17 @@ files:
113
117
  - lib/easy_data/templates/easy_datas/show_all.html.erb
114
118
  - lib/easy_data/templates/easy_datas/show_all.xml.builder
115
119
  - lib/easy_data/templates/easy_datas/view_settings.html.erb
120
+ - lib/easy_data/templates/images/LogoEasyData.jpg
116
121
  - lib/easy_data/templates/images/bg_ft.png
117
122
  - lib/easy_data/templates/images/bg_link.jpg
118
123
  - lib/easy_data/templates/images/easy_data_logo.png
124
+ - lib/easy_data/templates/images/lock.png
125
+ - lib/easy_data/templates/images/loginBt.png
126
+ - lib/easy_data/templates/images/login_bg.png
119
127
  - lib/easy_data/templates/images/logo_ft.png
120
- - lib/easy_data/templates/images/main_menu.jpg
121
- - lib/easy_data/templates/images/rdf_icon.jpeg
128
+ - lib/easy_data/templates/images/powerby.jpg
129
+ - lib/easy_data/templates/images/rdf_icon.png
130
+ - lib/easy_data/templates/images/rdf_icon_s.png
122
131
  - lib/easy_data/templates/images/shadow_menu.png
123
132
  - lib/easy_data/templates/layouts/easy_data_layout.html.erb
124
133
  - lib/easy_data/templates/rdf/request.xml.builder
@@ -127,7 +136,13 @@ files:
127
136
  - lib/easy_data/version.rb
128
137
  - lib/routes.rb
129
138
  - lib/tasks/testing_installation.rb
130
- has_rdoc: true
139
+ - test/data_models_test.rb
140
+ - test/rdfa_test.rb
141
+ - test/unit/RDFa_test.rb
142
+ - test/unit/data_models_test.rb
143
+ - test/unit/linked_data_graph_test.rb
144
+ - test/unit/model_rdf_test.rb
145
+ - test/unit/namespaces_test.rb
131
146
  homepage: http://rubygems.org/gem/easy_data
132
147
  licenses: []
133
148
 
@@ -157,9 +172,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
172
  requirements: []
158
173
 
159
174
  rubyforge_project: easy_data
160
- rubygems_version: 1.3.7
175
+ rubygems_version: 1.8.10
161
176
  signing_key:
162
177
  specification_version: 3
163
178
  summary: This is not a summary
164
- test_files: []
165
-
179
+ test_files:
180
+ - test/data_models_test.rb
181
+ - test/rdfa_test.rb
182
+ - test/unit/RDFa_test.rb
183
+ - test/unit/data_models_test.rb
184
+ - test/unit/linked_data_graph_test.rb
185
+ - test/unit/model_rdf_test.rb
186
+ - test/unit/namespaces_test.rb