Skip to content

Commit

Permalink
Solr fix
Browse files Browse the repository at this point in the history
  • Loading branch information
robcalla committed Oct 16, 2018
1 parent b669ba3 commit 6996b7f
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ public static Resource getRDFClass() {

public SolrInputDocument toDoc(CacheContentType contentType) {
SolrInputDocument doc = new SolrInputDocument();
doc.addField("id", UUID.randomUUID().toString());
doc.addField("id", this.id);
doc.addField("nodeID", this.nodeID);
doc.addField("content_type", contentType.toString());
doc.addField("uri", StringUtils.isNotBlank(this.uri) ? this.uri : "");
doc.addField("name", this.name != null ? this.name.getValue() : "");
Expand Down
3 changes: 2 additions & 1 deletion Idra/src/main/java/it/eng/idra/beans/dcat/DCTLocation.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ public static Resource getRDFClass() {

public SolrInputDocument toDoc(CacheContentType contentType) {
SolrInputDocument doc = new SolrInputDocument();
doc.addField("id", UUID.randomUUID().toString());
doc.addField("id", this.id);
doc.addField("nodeID", this.nodeID);
doc.addField("content_type", contentType.toString());
doc.addField("geographicalIdentifier",
this.geographicalIdentifier != null ? this.geographicalIdentifier.getValue() : "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ public static Resource getRDFClass() {

public SolrInputDocument toDoc(CacheContentType contentType) {
SolrInputDocument doc = new SolrInputDocument();
doc.addField("id", UUID.randomUUID().toString());
doc.addField("id", this.id);
doc.addField("nodeID", this.nodeID);
doc.addField("content_type", contentType.toString());
doc.addField("startDate", this.startDate != null ? this.startDate.getValue() : "");
doc.addField("endDate", this.endDate != null ? this.endDate.getValue() : "");
Expand Down
3 changes: 2 additions & 1 deletion Idra/src/main/java/it/eng/idra/beans/dcat/DCTStandard.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ public static Resource getRDFClass() {

public SolrInputDocument toDoc(CacheContentType contentType) {
SolrInputDocument doc = new SolrInputDocument();
doc.addField("id", UUID.randomUUID().toString());
doc.addField("id", this.id);
doc.addField("nodeID", this.nodeID);
doc.addField("content_type", contentType.toString());
doc.addField("uri", this.uri);
doc.addField("identifier", this.getIdentifier().getValue());
Expand Down
4 changes: 3 additions & 1 deletion Idra/src/main/java/it/eng/idra/beans/dcat/FOAFAgent.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,16 @@ public void setIdentifier(DCATProperty identifier) {
public SolrInputDocument toDoc(CacheContentType contentType) {

SolrInputDocument doc = new SolrInputDocument();
doc.addField("id", UUID.randomUUID().toString());
doc.addField("id", this.id);
doc.addField("nodeID", this.nodeID);
doc.addField("content_type", contentType.toString());
doc.addField("resourceUri", this.resourceUri);
doc.addField("identifier", this.getIdentifier().getValue());
doc.addField("name", this.getName().getValue());
doc.addField("mbox", this.getMbox().getValue());
doc.addField("homepage", this.getHomepage().getValue());
doc.addField("type", this.getType().getValue());

return doc;
}

Expand Down
3 changes: 2 additions & 1 deletion Idra/src/main/java/it/eng/idra/beans/dcat/SKOSConcept.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ public void setPrefLabel(List<SKOSPrefLabel> prefLabel) {
public SolrInputDocument toDoc(CacheContentType contentType) {

SolrInputDocument doc = new SolrInputDocument();
doc.addField("id", UUID.randomUUID().toString());
doc.addField("id", this.id);
doc.addField("nodeID", this.nodeID);
doc.addField("content_type", contentType.toString());
doc.addField("resourceUri", this.resourceUri);

Expand Down
3 changes: 2 additions & 1 deletion Idra/src/main/java/it/eng/idra/beans/dcat/SKOSPrefLabel.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ public void setValue(String value) {
public SolrInputDocument toDoc(CacheContentType contentType) {

SolrInputDocument doc = new SolrInputDocument();
doc.addField("id", UUID.randomUUID().toString());
doc.addField("id", this.id);
doc.addField("nodeID", this.nodeID);
doc.addField("content_type", contentType.toString());
doc.addField("value", this.getValue());
doc.addField("language", this.getLanguage());
Expand Down
3 changes: 2 additions & 1 deletion Idra/src/main/java/it/eng/idra/beans/dcat/SPDXChecksum.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ public void setChecksumValue(DCATProperty checksumValue) {

public SolrInputDocument toDoc(CacheContentType contentType) {
SolrInputDocument doc = new SolrInputDocument();
doc.addField("id", UUID.randomUUID().toString());
doc.addField("id", this.id);
doc.addField("nodeID", this.nodeID);
doc.addField("content_type", contentType.toString());
doc.addField("algorithm", this.algorithm != null ? this.algorithm.getValue() : "");
doc.addField("checksumValue", this.checksumValue != null ? this.checksumValue.getValue() : "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public void setHasTelephoneType(DCATProperty hasTelephoneType) {
public SolrInputDocument toDoc(CacheContentType contentType) {
SolrInputDocument doc = new SolrInputDocument();
doc.addField("id", this.id);
doc.addField("nodeID", this.nodeID);
doc.addField("content_type", contentType.toString());
doc.addField("resourceUri", this.resourceUri);
doc.addField("fn", this.getFn().getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,7 @@ public static void init(boolean createCache, String configPath) {
try {
// Clean previous index data
server.deleteByQuery("*:*");
server.commit();

/*
*
Expand Down
5 changes: 3 additions & 2 deletions Idra/src/main/java/it/eng/idra/odfscheduler/ODFScheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public void rescheduleJob(String jobName,ODMSCatalogue node) {
Trigger newTrigger = TriggerBuilder
.newTrigger()
.withIdentity(Integer.toString(node.getId()), "triggers")
.startAt(Date.from(node.getRegisterDate().toInstant()))
.startAt(Date.from(node.getRegisterDate().toInstant().plusSeconds(node.getRefreshPeriod())))
.withSchedule(simpleSchedule().repeatForever()
.withIntervalInSeconds(node.getRefreshPeriod())
.withMisfireHandlingInstructionNextWithExistingCount())
Expand Down Expand Up @@ -247,7 +247,8 @@ public void startCataloguesSynchJob(ODMSCatalogue node,boolean startNow) {
.withIdentity(Integer.toString(node.getId()), "jobs").usingJobData("nodeID",node.getId()).
build();

Date d = Date.from(node.getRegisterDate().toInstant());

Date d = Date.from(node.getRegisterDate().toInstant().plusSeconds(node.getRefreshPeriod()));

Trigger trigger = TriggerBuilder
.newTrigger()
Expand Down
2 changes: 1 addition & 1 deletion IdraPortal/src/main/webapp/catalogues/ViewCatalogues.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
<span class="md-headline"><span ng-show="node.country!='' && node.country!=undefined"
style="border-style: solid;border-width: 1px;border-color: rgba(0,0,0,0.1)" class="flag-icon "
ng-class="'flag-icon-'+node.country.toLowerCase()"></span>
<a href="{{node.host}}" target="_blank">{{node.name}}</a>
<a href="{{node.homepage}}" target="_blank">{{node.name}}</a>
<a href="javascript:void(0)" class="btn-flat mdi-material-deep-orange"
ng-click="showDatasets(node)"><i class="mdi-action-search"></i>
<md-tooltip>Show Datasets</md-tooltip></a>
Expand Down
4 changes: 4 additions & 0 deletions IdraPortal/src/main/webapp/catalogues/remote_catalogues.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ angular.module("IdraPlatform").controller('RemoteCataloguesController',["$scope"
delete node.sitemap.navigationParameter.id;
}

if(!node.hasOwnProperty("homepage")){
node.homepage=node.host;
}

var fd = new FormData();
fd.append("node",JSON.stringify(node));
fd.append("dump",'');
Expand Down

0 comments on commit 6996b7f

Please sign in to comment.