Skip to content

Commit

Permalink
Added homepage to ODMSCatalogue
Browse files Browse the repository at this point in the history
  • Loading branch information
robcalla committed Oct 11, 2018
1 parent 499793b commit 1510cf6
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 92 deletions.
22 changes: 19 additions & 3 deletions Idra/src/main/java/it/eng/idra/beans/odms/ODMSCatalogue.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ public class ODMSCatalogue {
@Column(name = "host", unique = true, nullable = false)
@Expose
private String host;

@JsonRequired
@Column(name = "homepage", unique = false, nullable = false)
@Expose
private String homepage;

@Column(name = "api_key", unique = false, nullable = true)
private String APIKey;
Expand Down Expand Up @@ -197,13 +202,14 @@ public ODMSCatalogue() {
}

// Throws exception if the type of new object is not allowed
public ODMSCatalogue(String name, String host, String APIKey, ODMSCatalogueType nodeType,
public ODMSCatalogue(String name, String host,String homepage, String APIKey, ODMSCatalogueType nodeType,
ODMSCatalogueFederationLevel federationLevel, int datasetCount, ODMSCatalogueState nodeState,
ZonedDateTime registerDate, ZonedDateTime lastUpdateDate, int refreshPeriod, String description,
String image, int rdfCount, String location, String locationDescription) {

this.setName(name);
this.setHost(host);
this.setHomepage(homepage);
this.setAPIKey(APIKey);
this.setNodeType(nodeType);
this.setFederationLevel(federationLevel);
Expand All @@ -222,14 +228,15 @@ public ODMSCatalogue(String name, String host, String APIKey, ODMSCatalogueType
}

// Throws exception if the type of new object is not allowed
public ODMSCatalogue(int id, String name, String host, String APIKey, ODMSCatalogueType nodeType,
public ODMSCatalogue(int id, String name, String host,String homepage, String APIKey, ODMSCatalogueType nodeType,
ODMSCatalogueFederationLevel integrationLevel, int datasetCount, ODMSCatalogueState nodeState,
ZonedDateTime registerDate, ZonedDateTime lastUpdateDate, int refresh_period, String description,
String image, int rdfCount, String location, String locationDescription) {

this.setId(id);
this.setName(name);
this.setHost(host);
this.setHomepage(homepage);
this.setAPIKey(APIKey);
this.setNodeType(nodeType);
this.setFederationLevel(integrationLevel);
Expand All @@ -247,14 +254,15 @@ public ODMSCatalogue(int id, String name, String host, String APIKey, ODMSCatalo
this.setLocationDescription(locationDescription);
}

public ODMSCatalogue(int id, String name, String host, String APIKey, ODMSCatalogueType nodeType,
public ODMSCatalogue(int id, String name, String host,String homepage, String APIKey, ODMSCatalogueType nodeType,
ODMSCatalogueFederationLevel integrationLevel, int datasetCount, ODMSCatalogueState nodeState,
ZonedDateTime registerDate, ZonedDateTime lastUpdateDate, int refresh_period, String description,
String image, int rdfCount, int startDataset, String location, String locationDescription) {

this.setId(id);
this.setName(name);
this.setHost(host);
this.setHomepage(homepage);
this.setAPIKey(APIKey);
this.setNodeType(nodeType);
this.setFederationLevel(integrationLevel);
Expand Down Expand Up @@ -299,6 +307,14 @@ public String getHost() {
public void setHost(String host) {
this.host = host;
}

public String getHomepage() {
return homepage;
}

public void setHomepage(String homepage) {
this.homepage = homepage;
}

public String getAPIKey() {
return APIKey;
Expand Down
81 changes: 35 additions & 46 deletions IdraPortal/src/main/webapp/catalogues/Catalogue.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,47 @@
</div>
<div class="col-md-8">
<form class="form-signin" name="userForm">
<div class="col-md-6 form-group"
<div class="col-md-12 form-group"
ng-class="{ 'has-error': node.nameInvalid || checkNodeName()}">
<label for="name">Name:</label> <input type="text" name="name"
class="form-control" ng-model="node.name" ng-required />
<p class="help-block" ng-if="node.nameInvalid">{{messageName}}</p>
<p class="help-block" ng-if="checkNodeName()">Catalogue name exists</p>
</div>
<div class="col-md-6 form-group"
<div class="col-md-12 form-group"
ng-class="{ 'has-error': node.pubNameInvalid }">
<label for="publisherName">Publisher Name:</label> <input
type="text" name="publisherName" class="form-control"
ng-model="node.publisherName" ng-required />
<p class="help-block" ng-if="node.pubNameInvalid">{{messageName}}</p>
<!-- <p class="help-block" ng-if="checkNodeName()">Publisher Name exists</p> -->
<p class="help-block" ng-if="node.pubNameInvalid">{{messagePublisher}}</p>
</div>
<div class="col-md-6 form-group"
<div class="col-md-6 form-group">
<label for="name">Country:</label>
<country-select class="form-control" ng-model="node.country"></country-select>
</div>
<div class="col-md-6 form-group">
<label for="host">Category:
</label> <select
class="form-control" ng-model="node.category"
ng-options="option.value as option.text for option in ODMSCategories">
</select>
</div>
<div class="col-md-12 form-group">
<label for="description">Description:</label>
<textarea class="form-control" rows="2" ng-model="node.description"></textarea>
</div>

<div class="col-md-12 form-group"
ng-class="{ 'has-error': node.homepageInvalid }">
<label for="host">Homepage:</label> <input type="url" name="host"
class="form-control" ng-model="node.homepage" ng-required />
<p class="help-block" ng-if="node.homepageInvalid">{{messageHomepage}}</p>
<!-- <p class="help-block" ng-if="checkNodeHomepage() && mode=='create'">Catalogue -->
<!-- host exists</p> -->
</div>
<div class="col-md-12 form-group"
ng-class="{ 'has-error': node.hostInvalid || checkNodeHost() }">
<label for="host">Host:</label> <input type="url" name="host"
<label for="host">API Endpoint:</label> <input type="url" name="host"
ng-disabled=" mode=='update'" class="form-control"
ng-model="node.host" ng-required />
<p class="help-block" ng-if="node.hostInvalid">{{messageUrl}}</p>
Expand All @@ -84,54 +107,23 @@
</select>
</div>
<div class="col-md-3 form-group">
<label for="refreshPeriod">Refresh Period:</label> <select
<label for="refreshPeriod">Refresh:</label> <select
class="form-control" ng-model="node.refreshPeriod"
class="form-control"
ng-options="option.value as option.text for option in updatePeriods">
</select>
</div>
<div class="col-md-3 form-group">
<label for="name">Country:</label>
<country-select class="form-control" ng-model="node.country"></country-select>
</div>
<div class="col-md-3 form-group">
<label for="host">Category:
</label> <select
class="form-control" ng-model="node.category"
ng-options="option.value as option.text for option in ODMSCategories">
</select>
</div>

<div class="col-md-12 form-group "
ng-show="node.nodeType == 'WEB' || node.nodeType == 'DCATDUMP' || node.nodeType == 'ORION' || node.nodeType == 'SPARQL'">
<!-- <div class="col-md-2" ng-if="node.nodeType == 'SPARQL' || node.nodeType == 'ORION'"></div> -->
<div class="col-md-4"></div>
<!-- <div class="col-md-4"> -->
<!-- <span ng-if="node.nodeType == 'WEB'" -->
<!-- class="btn btn-md btn-primary btn-file btn-material-deep-orange"> -->
<!-- Upload Sitemap <input type="file" name="file" -->
<!-- onchange="angular.element(this).scope().fileUploadWEB(this)" -->
<!-- accept=".json"> -->
<!-- </span> -->
<!-- <span ng-if="node.nodeType == 'DCATDUMP'" -->
<!-- class="btn btn-md btn-primary btn-file btn-material-deep-orange"> -->
<!-- Upload Dump <input type="file" name="file" -->
<!-- onchange="angular.element(this).scope().fileUploadDUMP(this)" -->
<!-- accept=".rdf, .xml"> -->
<!-- </span> -->
<!-- <span ng-if="node.nodeType == 'SPARQL' || node.nodeType == 'ORION'" -->
<!-- class="btn btn-md btn-primary btn-file btn-material-deep-orange"> -->
<!-- Upload Datasets <input type="file" name="file" -->
<!-- onchange="angular.element(this).scope().fileUploadORION_SPARQL(this)" -->
<!-- accept=".json"> -->
<!-- </span> -->
<!-- </div> -->
<div class="col-md-4">
<!-- <div class="col-md-4"></div> -->
<!-- <div class="col-md-4"> -->
<button type="button"
class="btn btn-md btn-primary btn-file btn-material-deep-orange" style="margin: 0px"
ng-click="openDumpModal()">
<span ng-if="mode=='create'">Add</span> <span ng-if="mode=='update'">Update</span> File
</button>
</div>
<!-- </div> -->
</div>
<div class="col-md-6 form-group"
ng-class="{ 'has-error': dumpInvalid }"
Expand Down Expand Up @@ -195,10 +187,7 @@
</span>
</div>

<div class="col-md-12 form-group">
<label for="description">Description:</label>
<textarea class="form-control" rows="4" ng-model="node.description"></textarea>
</div>

<!-- <div class="col-md-6 form-group"> -->
<!-- <label for="description">Location Description:</label> -->
<!-- <input type="text" name="locationArea" -->
Expand Down
18 changes: 9 additions & 9 deletions IdraPortal/src/main/webapp/catalogues/Catalogues.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
<tr>
<th st-sort="getters.isActive" style="width: 1%">Active</th>
<th st-sort="getters.name" st-sort-default="true"
style="width: 14%">Name</th>
<th st-sort="getters.host" style="width: 10%">Host</th>
style="width: 24%">Name</th>
<!-- <th st-sort="getters.host" style="width: 10%">Host</th> -->
<th st-sort="getters.type" style="width: 8%">Type</th>
<th st-sort="getters.federationLevel" style="width: 5%">Level</th>
<th st-sort="getters.status" style="width: 8%">Status</th>
Expand Down Expand Up @@ -69,13 +69,13 @@
<switch id="active" name="active" ng-model="node.isActive" ng-change="changed(node)" disabled="node.synchLock!='NONE'" class="small"></switch>
</td>
<td>
{{node.name | limitTo:28}}{{node.name.length > 28 ? '...' : ''}}
<md-tooltip ng-show="node.name.length > 28">{{node.name}}</md-tooltip>
</td>
<td>
{{node.host | limitTo:28}}{{node.host.length > 28 ? '...' : ''}}
<md-tooltip ng-show="node.host.length > 28">{{node.host}}</md-tooltip>
{{node.name | limitTo:40}}{{node.name.length > 40 ? '...' : ''}}
<md-tooltip ng-show="node.name.length > 40">{{node.name}}</md-tooltip>
</td>
<!-- <td> -->
<!-- {{node.host | limitTo:28}}{{node.host.length > 28 ? '...' : ''}} -->
<!-- <md-tooltip ng-show="node.host.length > 28">{{node.host}}</md-tooltip> -->
<!-- </td> -->
<td>{{node.nodeType}}</td>
<td>{{node.federationLevel.split("_")[1]}}</td>
<td><span
Expand Down Expand Up @@ -131,7 +131,7 @@
<tfoot>
<tr>
<!-- <td></td> -->
<td colspan="5" class="text-center">
<td colspan="4" class="text-center">
<div st-pagination="" st-items-by-page="itemsByPage"
st-displayed-pages="7"></div>
</td>
Expand Down
8 changes: 4 additions & 4 deletions IdraPortal/src/main/webapp/catalogues/ViewCatalogues.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<tr>
<th st-sort="name">Name</th>
<th st-sort="country">Country</th>
<th st-sort="host">Host</th>
<th st-sort="homepage">Homepage</th>
<th st-sort="category">Category</th>
<th st-sort="datasetCount">Datasets</th>
<th st-sort="lastUpdate">Last Update</th>
Expand All @@ -54,8 +54,8 @@
<span ng-show="node.country!=''">{{node.country}}</span>
<span ng-show="!node.country">-</span>
</td>
<td><a href="{{node.host}}" target="_blank">
{{node.host}}
<td><a href="{{node.homepage}}" target="_blank">
{{node.homepage}}
</a>
<md-tooltip >Homepage</md-tooltip>
</td>
Expand Down Expand Up @@ -89,7 +89,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
2 changes: 1 addition & 1 deletion IdraPortal/src/main/webapp/catalogues/catalogues.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ angular.module("IdraPlatform").controller('CataloguesController',["$scope","$htt
}


$scope.itemsByPage=10;
$scope.itemsByPage=8;

$scope.selectedPredicate = $scope.predicates[0];

Expand Down

0 comments on commit 1510cf6

Please sign in to comment.