Author: enridaga
Date: Mon Jan 16 11:58:44 2012
New Revision: 1231961

URL: http://svn.apache.org/viewvc?rev=1231961&view=rev
Log:
Filtered scripts and links, to avoid duplication on unwanted files to be part 
of the page (STANBOL-378). Still remains a problem with the creation of ontonet 
session. The motivation could be a change in the ontonet rest api

Modified:
    
incubator/stanbol/trunk/demos/integritycheck/src/main/java/org/apache/stanbol/demos/integritycheck/resources/IntegrityCheckResource.java
    
incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/static/integritycheck.js

Modified: 
incubator/stanbol/trunk/demos/integritycheck/src/main/java/org/apache/stanbol/demos/integritycheck/resources/IntegrityCheckResource.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/demos/integritycheck/src/main/java/org/apache/stanbol/demos/integritycheck/resources/IntegrityCheckResource.java?rev=1231961&r1=1231960&r2=1231961&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/demos/integritycheck/src/main/java/org/apache/stanbol/demos/integritycheck/resources/IntegrityCheckResource.java
 (original)
+++ 
incubator/stanbol/trunk/demos/integritycheck/src/main/java/org/apache/stanbol/demos/integritycheck/resources/IntegrityCheckResource.java
 Mon Jan 16 11:58:44 2012
@@ -2,8 +2,11 @@ package org.apache.stanbol.demos.integri
 
 import static javax.ws.rs.core.MediaType.TEXT_HTML;
 
-import java.util.Collections;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
@@ -11,6 +14,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import org.apache.stanbol.commons.web.base.LinkResource;
 import org.apache.stanbol.commons.web.base.ScriptResource;
 import org.apache.stanbol.commons.web.base.resource.BaseStanbolResource;
 
@@ -24,9 +28,36 @@ import com.sun.jersey.api.view.Viewable;
 @Path("/integritycheck")
 @ImplicitProduces(MediaType.TEXT_HTML + ";qs=2")
 public class IntegrityCheckResource extends BaseStanbolResource{
+       private final String[] TRUSTED_FRAGMENTS = {"home","integritycheck"};
        @GET
     @Produces(TEXT_HTML)
     public Response get() {
         return Response.ok(new Viewable("index", this), TEXT_HTML).build();
     }
+       
+       @Override
+       public List<LinkResource> getRegisteredLinkResources() {
+               List<LinkResource> links = super.getRegisteredLinkResources();
+               List<LinkResource> myLinks = new ArrayList<LinkResource>();
+               List<String> trusted =  Arrays.asList(TRUSTED_FRAGMENTS);
+               for(LinkResource r : links){
+                       if(trusted.contains(r.getFragmentName())){
+                               myLinks.add(r);
+                       }
+               }
+               return myLinks;
+       }
+       
+       @Override
+       public List<ScriptResource> getRegisteredScriptResources() {
+               List<ScriptResource> scripts = 
super.getRegisteredScriptResources();
+               List<ScriptResource> myScripts = new 
ArrayList<ScriptResource>();
+               List<String> trusted =  Arrays.asList(TRUSTED_FRAGMENTS);
+               for(ScriptResource r : scripts){
+                       if(trusted.contains(r.getFragmentName())){
+                               myScripts.add(r);
+                       }
+               }
+               return myScripts;
+       }
 }

Modified: 
incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/static/integritycheck.js
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/static/integritycheck.js?rev=1231961&r1=1231960&r2=1231961&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/static/integritycheck.js
 (original)
+++ 
incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/static/integritycheck.js
 Mon Jan 16 11:58:44 2012
@@ -7,7 +7,8 @@
  * @author enridaga, anuzzolese
  */
 $(document).ready(function(){
-       
+       // We must add this datatype to jqueryrdf
+       jQuery.typedValue.types["http://www.w3.org/2001/XMLSchema#long";] = 
jQuery.typedValue.types["http://www.w3.org/2001/XMLSchema#float";];
        // Base application URL, (we want to know this several times in the 
process)
        var baseA = document.createElement("a");
        baseA.href="/";


Reply via email to