Index: modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/Test.java
===================================================================
--- modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/Test.java	(revision 46976)
+++ modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/Test.java	(revision 46977)
@@ -32,4 +32,5 @@
 
 	}
 
+
 }
Index: modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/Migration.java
===================================================================
--- modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/Migration.java	(revision 46976)
+++ modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/Migration.java	(revision 46977)
@@ -7,6 +7,8 @@
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 import java.io.*;
+import java.math.BigInteger;
+import java.security.MessageDigest;
 import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.Date;
@@ -58,7 +60,7 @@
             claim.setUserMail(relation.getClaimedBy());
             claim.setDate(relation.getClaimDate());
             claim.setId(relation.getClaimId());
-
+            System.out.println("Claim id:" + claim.getId());
             OpenaireEntity source = null;
             //first work with the Source
             if (relation.getSourceType().equals(ClaimUtils.PROJECT)) {
@@ -230,9 +232,12 @@
                 try {
                     result.setAccessRights(dmfResultHandler.fetchAccessRights(dmf));
                     result.setEmbargoEndDate(dmfResultHandler.fetchEmbargoEndDateByDMF(dmf));
-                    //TODO check if we need the openaire id when it collected from external sources !!
                     if(result.getOpenaireId() == null ){
-                        result.setOpenaireId(resultId);
+                        String id=resultId;
+                        MessageDigest m=MessageDigest.getInstance("MD5");
+                        m.update(id.getBytes(),0,id.length());
+                        id = new BigInteger(1,m.digest()).toString(16);
+                        result.setOpenaireId("user:claim__"+id);
                     }
                 } catch (Exception e) {
                     e.printStackTrace();
Index: modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/OafParser.java
===================================================================
--- modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/OafParser.java	(revision 46976)
+++ modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/OafParser.java	(revision 46977)
@@ -169,8 +169,11 @@
 
         }
         DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
-        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+        DocumentBuilder dBuilder = null;
+        try {
+            dBuilder = dbFactory.newDocumentBuilder();
 
+
         InputSource is = new InputSource(new StringReader(oaf));
         Document document= document=dBuilder.parse(is);
         XPathFactory xPathfactory= XPathFactory.newInstance();
@@ -222,7 +225,10 @@
             if (nl.getLength() > 0) {
                 project.setContactEmails(new ArrayList<String>());
                 for (int i = 0; i < nl.getLength(); i++) {
-                    project.getContactEmails().add(((Element)(nl.item(i).getParentNode())).getElementsByTagName("email").item(0).getTextContent());
+                    if(((Element)(nl.item(i).getParentNode())).getElementsByTagName("email").getLength() > 0) {
+                        String email = ((Element) (nl.item(i).getParentNode())).getElementsByTagName("email").item(0).getTextContent();
+                        project.getContactEmails().add(email);
+                    }
                 }
             }
 
@@ -229,6 +235,11 @@
 //            project.setFound(true);
 
         }
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.out.println("Project"+oaf);
+            throw new Exception();
+        }
 
         return project;
 
Index: modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/ExternalRecordParser.java
===================================================================
--- modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/ExternalRecordParser.java	(revision 46976)
+++ modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/ExternalRecordParser.java	(revision 46977)
@@ -55,8 +55,10 @@
             Response.Message.Item item = obj.getMessage().getItems().get(0);
             if (item.getTitle()!=null && item.getTitle().size()>0){
                 result.setTitle(item.getTitle().get(0));
-                for (int i=0; i < item.getAuthor().size(); i++) {
-                    result.getAuthors().put(i+"", item.getAuthor().get(i).getGiven() + " " + item.getAuthor().get(i).getFamily());
+                if(item.getAuthor() != null) {
+                    for (int i = 0; i < item.getAuthor().size(); i++) {
+                        result.getAuthors().put(i + "", item.getAuthor().get(i).getGiven() + " " + item.getAuthor().get(i).getFamily());
+                    }
                 }
             }
             result.setDoi(item.getDOI());
Index: modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/DirectIndexHandler.java
===================================================================
--- modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/DirectIndexHandler.java	(nonexistent)
+++ modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/DirectIndexHandler.java	(revision 46977)
@@ -0,0 +1,171 @@
+package eu.dnetlib.data.claims.migration.handler;
+
+import org.apache.log4j.Logger;
+import org.json.simple.JSONObject;
+import sun.net.www.protocol.http.HttpURLConnection;
+
+import java.io.*;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+
+/**
+ * Created by argirok on 26/4/2017.
+ */
+public class DirectIndexHandler {
+
+    private String directClaimAPIUrl;
+    private static final Logger logger = Logger.getLogger(DirectIndexHandler.class);
+
+    public void test(){
+        System.out.println("Hereee!!!!!!!!!!!!!!!");
+    }
+    public boolean insertRecord(String record){
+
+        return this.feedIndex(record);
+    }
+    public boolean updateRecord(String record){
+
+        return this.feedIndex(record);
+    }
+    public boolean deleteRecord(String originalId, String collectedFromId){
+
+        return this.removeObjectFromIndex(originalId,collectedFromId);
+    }
+
+    private boolean feedIndex(String record) {
+
+        URL obj = null;
+        try {
+            obj = new URL(directClaimAPIUrl+"/feedObject");
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+            logger.error("Malformed  direct Claim APIUrl" + directClaimAPIUrl);
+            return false;
+
+        }
+        HttpURLConnection con = null;
+        try {
+            con = (HttpURLConnection) obj.openConnection();
+
+
+
+            //add request header
+            con.setRequestMethod("POST");
+            //con.setRequestProperty("User-Agent", USER_AGENT);
+            con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
+            con.setRequestProperty("Content-Type", "application/json");
+
+            logger.info("Feeding index with " + record);
+            String urlParameters = record;
+
+            // Send post request
+            con.setDoOutput(true);
+            DataOutputStream wr = new DataOutputStream(con.getOutputStream());
+            BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(wr, "UTF-8"));
+            writer.write(urlParameters);
+            writer.close();
+            wr.close();
+
+            int responseCode = con.getResponseCode();
+            logger.info("\nSending 'POST' request to URL : " + directClaimAPIUrl);
+            logger.info("Post parameters : " + urlParameters);
+            logger.info("Response Code : " + responseCode);
+
+            BufferedReader in = new BufferedReader(
+                    new InputStreamReader(con.getInputStream()));
+            String inputLine;
+            StringBuffer response = new StringBuffer();
+
+            while ((inputLine = in.readLine()) != null) {
+                response.append(inputLine);
+            }
+            in.close();
+
+            //print result
+            logger.info(response.toString());
+            if(response.toString().equals("true")){
+                return true;
+            }else{
+                return false;
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+            logger.error("An error occured while trying to feed object" + e.getMessage());
+
+            return false;
+        }
+    }
+    private boolean removeObjectFromIndex(String originalId, String collectedFromId){
+
+        URL obj = null;
+        String urlParameters = "?originalId="+originalId+"&collectedFromId="+collectedFromId;
+
+        try {
+            obj = new URL(directClaimAPIUrl+"/deleteObject"+urlParameters);
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+            logger.error("Malformed  direct Claim APIUrl" + directClaimAPIUrl);
+            return false;
+
+        }
+        HttpURLConnection con = null;
+        try {
+            con = (HttpURLConnection) obj.openConnection();
+
+
+
+            //add request header
+            con.setRequestMethod("POST");
+            //con.setRequestProperty("User-Agent", USER_AGENT);
+            con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
+            con.setRequestProperty("Content-Type", "application/json");
+
+
+            // Send post request
+            con.setDoOutput(true);
+//            DataOutputStream wr = new DataOutputStream(con.getOutputStream());
+//            BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(wr, "UTF-8"));
+//            writer.write(urlParameters);
+//            writer.close();
+//            wr.close();
+
+            int responseCode = con.getResponseCode();
+            logger.info("\nSending 'POST' request to URL : " + directClaimAPIUrl+urlParameters);
+            logger.info("Post parameters : " + urlParameters);
+            logger.info("Response Code : " + responseCode);
+
+            BufferedReader in = new BufferedReader(
+                    new InputStreamReader(con.getInputStream()));
+            String inputLine;
+            StringBuffer response = new StringBuffer();
+
+            while ((inputLine = in.readLine()) != null) {
+                response.append(inputLine);
+            }
+            in.close();
+
+            //print result
+            logger.info(response.toString());
+            if(response.toString().equals("true")){
+                return true;
+            }else{
+                return false;
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+            logger.error("An error occured while trying to delete object" + e.getMessage());
+
+            return false;
+        }
+    }
+
+    public String getDirectClaimAPIUrl() {
+        return directClaimAPIUrl;
+    }
+
+    public void setDirectClaimAPIUrl(String directClaimAPIUrl) {
+        this.directClaimAPIUrl = directClaimAPIUrl;
+    }
+}
Index: modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ClaimHandler.java
===================================================================
--- modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ClaimHandler.java	(revision 46976)
+++ modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ClaimHandler.java	(revision 46977)
@@ -10,6 +10,8 @@
 import eu.dnetlib.enabling.is.registry.schema.ValidationException;
 import org.apache.log4j.Logger;
 
+import java.math.BigInteger;
+import java.security.MessageDigest;
 import java.sql.ResultSet;
 import java.util.Date;
 import java.util.List;
@@ -157,19 +159,36 @@
             if(collectedFrom == null){
                 return null;
             }else if(collectedFrom.equals(ClaimUtils.CROSSREF)){
+
                 Result result = externalRecordHandler.fetchResultfromCrossref(id);
                 result.setAccessRights(accessRights);
                 result.setEmbargoEndDate(embargoDate);
+                String md5Id=id;
+                MessageDigest m=MessageDigest.getInstance("MD5");
+                m.update(md5Id.getBytes(),0,md5Id.length());
+                md5Id = new BigInteger(1,m.digest()).toString(16);
+                result.setOpenaireId("user:claim__"+md5Id);
                 return result;
             }else if (collectedFrom.equals(ClaimUtils.DATACITE)){
                 Result result = externalRecordHandler.fetchResultfromDatacite(id);
+                System.out.println("\n\n accessRights:"+accessRights);
                 result.setAccessRights(accessRights);
                 result.setEmbargoEndDate(embargoDate);
+                String md5Id=id;
+                MessageDigest m=MessageDigest.getInstance("MD5");
+                m.update(md5Id.getBytes(),0,md5Id.length());
+                md5Id = new BigInteger(1,m.digest()).toString(16);
+                result.setOpenaireId("user:claim__"+md5Id);
                 return result;
             }else if (collectedFrom.equals(ClaimUtils.ORCID)){
                 Result result = externalRecordHandler.fetchResultfromOrcid(id);
                 result.setAccessRights(accessRights);
                 result.setEmbargoEndDate(embargoDate);
+                String md5Id=id;
+                MessageDigest m=MessageDigest.getInstance("MD5");
+                m.update(md5Id.getBytes(),0,md5Id.length());
+                md5Id = new BigInteger(1,m.digest()).toString(16);
+                result.setOpenaireId("user:claim__"+md5Id);
                 return result;
             }else if (collectedFrom.equals(ClaimUtils.OPENAIRE)){
                 IndexResultHandler indexResultHandler = new IndexResultHandler();
Index: modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SqlDAO.java
===================================================================
--- modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SqlDAO.java	(revision 46976)
+++ modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SqlDAO.java	(revision 46977)
@@ -96,6 +96,7 @@
 			return rs;
 
 		} catch (Exception e) {
+			System.out.print("\n Query is:"+q);
 			log.error("Fail to execute query:" + q, e);
 			throw new Exception(e);
 		}
Index: modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/TestClass.java
===================================================================
--- modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/TestClass.java	(revision 46976)
+++ modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/TestClass.java	(revision 46977)
@@ -33,6 +33,8 @@
 import javax.xml.transform.TransformerException;
 import javax.xml.xpath.XPathExpressionException;
 import java.io.IOException;
+import java.math.BigInteger;
+import java.security.MessageDigest;
 import java.sql.ResultSet;
 import java.util.*;
 
@@ -56,6 +58,7 @@
     RelationHandler relationHandler = null;
     ContextRelationHandler contextRelationHandler = null;
     ProjectHandler projectHandler = null;
+    DirectIndexHandler directIndexHandler = null;
     FetchProjectHandler fetchProjectHandler = null;
     DMFContextHandler dmfContextHandler = null;
     DMFResultHandler dmfResultHandler = null;
@@ -73,6 +76,7 @@
 		BasicConfigurator.configure();
         ApplicationContext context = new ClassPathXmlApplicationContext("eu/dnetlib/data/claims/migration/springContext-claimsDemo.xml");
         relationHandler = context.getBean(RelationHandler.class);
+        directIndexHandler = context.getBean(DirectIndexHandler.class);
         contextRelationHandler = context.getBean(ContextRelationHandler.class);
         projectHandler = context.getBean(ProjectHandler.class);
         fetchProjectHandler = context.getBean(FetchProjectHandler.class);
@@ -178,11 +182,11 @@
  //acm_________::31e0e5e7cbd6e2556336d7e795f55c49
 //dedup_wf_001::64ca1e3a4d1590456ad3dd7df8a18cd7
  
-//        String id=claimHandler.buildAndInsertClaim("argirok@di.uoa.gr", "project", "corda_______::2c37878a0cede85dbbd1081bb9b4a2f8", "openaire", null, null,"publication", "10.1093/oxfordhb/9780199603329.013.0040", "crossref", "EMBARGO","2017-05-01");
+        String id=claimHandler.buildAndInsertClaim("argirok@di.uoa.gr", "project", "corda_______::2c37878a0cede85dbbd1081bb9b4a2f8", "openaire", "OPEN", null,"dataset", "10.5281/ZENODO.154647", "datacite", "EMBARGO","2017-05-01");
 
 
-        String id=claimHandler.buildAndInsertClaim("argirok@di.uoa.gr", "context", "egi::country::gr",
-                "openaire", null, null,"dataset", "datacite____::05418b13284ac02b62c8b114dee80d37", "openaire", "OPEN","2017-05-01");
+//        String id=claimHandler.buildAndInsertClaim("argirok@di.uoa.gr", "context", "egi::country::gr",
+//                "openaire", null, null,"dataset", "datacite____::05418b13284ac02b62c8b114dee80d37", "openaire", "OPEN","2017-05-01");
     }
     @Test
     public void testDelete() throws Exception {
@@ -193,9 +197,9 @@
 
     @Test
 	public void testJob() throws Exception {
-        String selectcountDMFClaims =" Select count(*) from claims_view  where type='dmf2actions' and xml NOT ILIKE '%<oaf:concept%' ";
-        String selectCountConceptClaims =" Select count(*) from claims_view  where ( type='dmf2actions' or type='updates2actions' ) and xml LIKE '%<oaf:concept%' ";
-        String selectCountRelationClaims =" Select count(*) from claims_view  where type='rels2actions'  ";
+        String selectcountDMFClaims =" Select count(*) from claims  where type='dmf2actions' and xml NOT ILIKE '%<oaf:concept%' ";
+        String selectCountConceptClaims =" Select count(*) from claims  where ( type='dmf2actions' or type='updates2actions' ) and xml LIKE '%<oaf:concept%' ";
+        String selectCountRelationClaims =" Select count(*) from claims  where type='rels2actions'  ";
 
         ResultSet rs = sqlDAO.executePreparedQuery(selectCountConceptClaims);
 
@@ -277,7 +281,7 @@
     }
     @Test
     public void createClaimTables() throws Exception {
-        sqlDAO.executeUpdateQuery(queryGenerator.generateCreateClaimTablesQuery());
+//        sqlDAO.executeUpdateQuery(queryGenerator.generateCreateClaimTablesQuery());
     }
 
     @Test
@@ -388,7 +392,24 @@
 
 
     }
+    @Test
+    public void testMD5() throws Exception {
+        String id = "10.1371/journal.pone.0130756";
+        MessageDigest m = MessageDigest.getInstance("MD5");
+        m.update(id.getBytes(), 0, id.length());
+        id = new BigInteger(1, m.digest()).toString(16);
+        System.out.println(id);
+    }
+    @Test
+    public void directIndexClaim() throws Exception {
+        directIndexHandler.test();
 
+        String json = "{\"originalId\":\"user:claim__d1e668dc81fa714aa98a558d9ce515fa\",\"title\":\"Expression of Ik6 and Ik8 Isoforms and Their Association with Relapse and Death in Mexican Children with Acute Lymphoblastic Leukemia\",\"authors\":[\"Reyes-León Adriana\",\"Juárez-Velázquez Rocío\",\"Medrano-Hernández Alma\",\"Cuenca-Roldán Teresa\",\"Salas-Labadía Consuelo\",\"del Pilar Navarrete-Meneses María\",\"Rivera-Luna Roberto\",\"López-Hernández Gerardo\",\"Paredes-Aguilera Rogelio\",\"Pérez-Vera Patricia\"],\"publisher\":\"Public Library of Science (PLoS)\",\"type\":\"publication\",\"pids\":[{\"type\":\"doi\",\"value\":\"10.1371/journal.pone.0130756\"}],\"licenseCode\":\"OPEN\",\"resourceType\":\"0001\",\"url\":\"http://dx.doi.org/10.1371/journal.pone.0130756\",\"hostedById\":\"openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18\",\"collectedFromId\":\"openaire____::crossref\",\"contexts\":[\"egi::country::gr\"]}";
+//        System.out.println("\n\nFeed Response is: "+directIndexHandler.insertRecord(json));
+
+//        System.out.println("\n\nDelete Response is: "+directIndexHandler.deleteRecord("user:claim__d1e668dc81fa714aa98a558d9ce515fa","openaire____::crossref"));
+    }
+
     @Test
     public void testJsonToClaimsCuration() throws Exception {
 
@@ -423,4 +444,5 @@
         this.fetchClaimHandler.updateClaimsCurationInfo(jsonstr);
     }
 
+
 }
Index: modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SearchUtils.java
===================================================================
--- modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SearchUtils.java	(revision 46976)
+++ modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SearchUtils.java	(revision 46977)
@@ -28,9 +28,9 @@
     private static String apiUrlForResults=" http://beta.services.openaire.eu:8480/search/api/";//"http://api.openaire.eu/search/";
     private static String apiUrlForDedupResults="http://rudie.di.uoa.gr:8080/dnet-functionality-services-1.2.0-SNAPSHOT/api/";
     private static String apiUrlForProjects="http://beta.services.openaire.eu:8480/search/api/";//"http://rudie.di.uoa.gr:8080/dnet-functionality-services-1.2.0-SNAPSHOT/api/";
-    private static String crossrefUrl="http://api.crossref.org/works?filter=doi:";
-    private static String dataciteUrl="http://data.datacite.org/application/rdf+xml/";
-    private static String orcidUrlPrefix="http://pub.orcid.org/";
+    private static String crossrefUrl="https://api.crossref.org/works?filter=doi:";
+    private static String dataciteUrl="https://data.datacite.org/application/rdf+xml/";
+    private static String orcidUrlPrefix="https://pub.orcid.org/";
     private static String orcidUrlSuffix="/orcid-works";
     private boolean useApi=true;
 
@@ -128,7 +128,6 @@
     }
 
     public static String fetchResultXMLFromDatacite(String id) throws Exception{
-
             return getRequest(getDataciteUrl(id));
     }
     public static String fetchResultXMLFromOrcid(String id) throws Exception{
@@ -202,7 +201,7 @@
             response.append(inputLine+"\n");
         }
         in.close();
-         return response.toString();
+        return response.toString();
     }
 
     public static String getCrossrefJsonRecord(String doi){
Index: modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/QueryGenerator.java
===================================================================
--- modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/QueryGenerator.java	(revision 46976)
+++ modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/QueryGenerator.java	(revision 46977)
@@ -374,7 +374,7 @@
                 "        funder_id varchar(60) NOT NULL,\n" +
                 "        funder_name varchar(60) NOT NULL,\n" +
                 "        funder_acronym varchar(60) NOT NULL,\n" +
-                "        notify notify boolean DEFAULT TRUE,\n" +
+                "        notify boolean DEFAULT TRUE,\n" +
                 "        contact_person varchar(60),\n" +
                 "        token varchar(60)\n" +
                 ");\n" +
@@ -475,8 +475,8 @@
      * @return
      */
     public String generateSelectConceptClaimsEnrichedWithDMFClaimsQuery(Integer limit) {
-        return " select rel.*, dmf.dmf from (Select * from claims_view  where  ( type='dmf2actions' or type='updates2actions' ) and xml LIKE '%<oaf:concept%') as rel left outer join \n" +
-                "(Select DISTINCT ON (resultid) resultid,date, xml as dmf from claims_view  where type='dmf2actions' and xml NOT ILIKE '%<oaf:concept%'   order by resultid,date desc , xml) as dmf on rel.resultid=dmf.resultid"
+        return " select rel.*, dmf.dmf from (Select * from claims  where  ( type='dmf2actions' or type='updates2actions' ) and xml LIKE '%<oaf:concept%') as rel left outer join \n" +
+                "(Select DISTINCT ON (resultid) resultid,date, xml as dmf from claims  where type='dmf2actions' and xml NOT ILIKE '%<oaf:concept%'   order by resultid,date desc , xml) as dmf on rel.resultid=dmf.resultid"
                 +(limit>0?" limit "+limit:"");
 
     }
@@ -488,13 +488,13 @@
 
     }
     public String generateSelectConceptClaimByIDEnrichedWithDMFClaimsQuery(Integer limit, String claimID) {
-        return " select rel.*, dmf.dmf from (Select * from claims_view  where id='"+claimID+"' and  ( type='dmf2actions' or type='updates2actions' ) and xml LIKE '%<oaf:concept%') as rel left outer join \n" +
-                "(Select DISTINCT ON (resultid) resultid,date, xml as dmf from claims_view  where type='dmf2actions' and xml NOT ILIKE '%<oaf:concept%'   order by resultid,date desc , xml)  as dmf on rel.resultid=dmf.resultid"
+        return " select rel.*, dmf.dmf from (Select * from claims  where id='"+claimID+"' and  ( type='dmf2actions' or type='updates2actions' ) and xml LIKE '%<oaf:concept%') as rel left outer join \n" +
+                "(Select DISTINCT ON (resultid) resultid,date, xml as dmf from claims  where type='dmf2actions' and xml NOT ILIKE '%<oaf:concept%'   order by resultid,date desc , xml)  as dmf on rel.resultid=dmf.resultid"
                 +(limit>0?" limit "+limit:"");
     }
     public String generateSelectRelationClaimByIDEnrichedWithDMFClaimsQuery(Integer limit, String claimID) {
-        return " select rel.*, dmf.dmf from (Select * from claims_view   where id='"+claimID+"' and type='rels2actions' ) as rel left outer join \n" +
-                "(Select DISTINCT ON (resultid) resultid,date, xml as dmf from claims_view  where type='dmf2actions' and xml NOT ILIKE '%<oaf:concept%'   order by resultid,date desc , xml) as dmf on rel.resultid=dmf.resultid"
+        return " select rel.*, dmf.dmf from (Select * from claims   where id='"+claimID+"' and type='rels2actions' ) as rel left outer join \n" +
+                "(Select DISTINCT ON (resultid) resultid,date, xml as dmf from claims  where type='dmf2actions' and xml NOT ILIKE '%<oaf:concept%'   order by resultid,date desc , xml) as dmf on rel.resultid=dmf.resultid"
                 +(limit>0?" limit "+limit:"");
     }
 
@@ -696,7 +696,7 @@
     }
 
     private  String getClaimFields() {
-        return " claim.id, claim.claim_date, claim.claimedBy, claim.source_type, claim.target_type, claim.semantics, curation_date, claim.curated_by, claim.approved ";
+        return " claim.id, claim.claim_date, claim.claimedBy, claim.source_type, claim.target_type, claim.semantics, claim.curation_date, claim.curated_by, claim.approved ";
     }
     private  String getResultFields(String tableAlias) {
         return " "+tableAlias+".openaire_id, "+tableAlias+".title  "+tableAlias+"_title, "+tableAlias+".result_type, "+tableAlias+".doi, "+tableAlias+".orcidworkid, "+tableAlias+".access_rights, "+tableAlias+".embargo_end_date, "+tableAlias+".best_license, "+tableAlias+".external_url,  "+tableAlias+".collected_from  ";
Index: modules/uoa-claims -demo/claims-demo/src/main/resources/eu/dnetlib/data/claims/migration/springContext-claimsDemo.xml
===================================================================
--- modules/uoa-claims -demo/claims-demo/src/main/resources/eu/dnetlib/data/claims/migration/springContext-claimsDemo.xml	(revision 46976)
+++ modules/uoa-claims -demo/claims-demo/src/main/resources/eu/dnetlib/data/claims/migration/springContext-claimsDemo.xml	(revision 46977)
@@ -15,6 +15,9 @@
         http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
 	http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd"
        default-autowire="byName">
+    <bean id="directIndexHandler" class="eu.dnetlib.data.claims.migration.handler.DirectIndexHandler">
+        <property name="directClaimAPIUrl"  value="http://beta.services.openaire.eu:8280/is/mvc/api/publications"/>
+    </bean>
     <bean id="fetchClaimHandler" class="eu.dnetlib.data.claims.migration.handler.FetchClaimHandler">
         <property name="sqlDAO" ref="sqlDao"/>
         <property name="queryGenerator" ref="queryGenerator"/>
@@ -102,8 +105,10 @@
         <property name="dbPassword" value="snowflakes"/>
         <property name="dbDriver" value="org.postgresql.Driver"/>
         <property name="dbUrl" value="jdbc:postgresql://scoobydoo.di.uoa.gr:5432/claimsnewschema"/>
+        <!--<property name="dbUrl" value="jdbc:postgresql://scoobydoo.di.uoa.gr:5432/claims_beta"/>-->
 
     </bean>
+
         <!--the following ititializes the values from .properties, and works for the war
         It doesn;t get values from override properties file
         and in main and tests sqlStore is not initialised correctly
Index: modules/uoa-claims -demo/claims-demo/src/main/resources/eu/dnetlib/data/claims/migration/springContext-claimsDemo.properties
===================================================================
--- modules/uoa-claims -demo/claims-demo/src/main/resources/eu/dnetlib/data/claims/migration/springContext-claimsDemo.properties	(revision 46976)
+++ modules/uoa-claims -demo/claims-demo/src/main/resources/eu/dnetlib/data/claims/migration/springContext-claimsDemo.properties	(revision 46977)
@@ -2,6 +2,7 @@
 services.claimsDemo.db.url = jdbc:postgresql://scoobydoo.di.uoa.gr:5432/claimsnewschema
 services.claimsDemo.db.username = postgres
 services.claimsDemo.db.password = snowflakes
+services.claimsDemo.directClaim.APIURL = http://beta.services.openaire.eu:8280/is/mvc/api/publications
 #FOR CLAIMSDB
 #services.eu.dnetlib.data.claimsDemo.db.url =jdbc:postgresql://services.openaire.eu:5432/db_openaireplus
 #services.eu.dnetlib.data.claimsDemo.db.username =dnet
