Skip to content

Commit 1479e06

Browse files
authored
Merge pull request #196 from AtlasOfLivingAustralia/experimental/bulk-annotations
Work for #195 and #194
2 parents b019f14 + 169c6e1 commit 1479e06

File tree

8 files changed

+95
-18
lines changed

8 files changed

+95
-18
lines changed

Diff for: grails-app/conf/application.yml

+2
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ dataResource:
245245
- "document"
246246
- "uploads"
247247
- "species-list"
248+
- "publications"
249+
- "events"
248250
permissionsDocumentTypes:
249251
- ""
250252
- "Email"

Diff for: grails-app/controllers/au/org/ala/collectory/DataController.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ class DataController {
500500

501501
// suppress 'declined' data resources
502502
if (urlForm == 'dataResource' && params.public == "true") {
503-
list = list.findAll { it.status != 'declined' }
503+
list = list.findAll { it.status != 'declined' && it.isPrivate == false }
504504
}
505505

506506
// init results with total

Diff for: grails-app/controllers/au/org/ala/collectory/PublicController.groovy

+6-3
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,9 @@ class PublicController {
464464
else if (instance.status == "declined") {
465465
render "This resource has decided to not contribute to the Atlas."
466466
}
467+
else if (instance.isPrivate) {
468+
render "This resource is private."
469+
}
467470
else {
468471
def suitableFor = providerGroupService.getSuitableFor()
469472
activityLogService.log collectoryAuthService?.username(), collectoryAuthService?.userInRole(grailsApplication.config.ROLE_ADMIN), instance.uid, Action.VIEW
@@ -527,15 +530,15 @@ class PublicController {
527530
def dataSets = {}
528531

529532
def dataSetSearch = {
530-
def drs = DataResource.findAllByNameLikeAndStatusNotEqual('%' + params.q + '%', 'declined').collect {
533+
def drs = DataResource.findAllByNameLikeAndStatusNotEqualAndIsPrivate('%' + params.q + '%', 'declined', false).collect {
531534
it.uid
532535
}
533536
render drs as JSON
534537
}
535538

536539
def resources = {
537540
cache shared:true, validFor: 3600*24
538-
def drs = DataResource.findAllByStatusNotEqual('declined', [sort:'name']).collect {
541+
def drs = DataResource.findAllByStatusNotEqualAndIsPrivate('declined', false, [sort:'name']).collect {
539542
//def drs = DataResource.list([sort:'name']).collect {
540543
def pdesc = it.pubDescription ? cl.formattedText(dummy:'1',limit(it.pubDescription,1000)) : ""
541544
def tdesc = it.techDescription ? cl.formattedText(dummy:'1',limit(it.techDescription,1000)) : ""
@@ -551,7 +554,7 @@ class PublicController {
551554
}
552555

553556
def condensed = {
554-
def drs = DataResource.findAllByStatusNotEqual('declined', [sort:'name'] ).collect {
557+
def drs = DataResource.findAllByStatusNotEqualAndIsPrivate('declined', false, [sort:'name'] ).collect {
555558
//def drs = DataResource.list([sort:'name']).collect {
556559
def inst = it.institution
557560
def instName = (inst && inst.name.size() > 36 && inst.acronym) ? inst.acronym : inst?.name

Diff for: grails-app/i18n/messages.properties

+29-7
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public.chart.radio.onf=Other named facet
2222
public.chart.radio.el=Environmental layer
2323

2424
public.datasets.title=Datasets
25-
public.datasets.header.title.param={0} data sets
25+
public.datasets.header.title.param={0} datasets
2626
public.datasets.header.message.param=Much of the content in the {0}, such as occurrence records, environmental data, images and the conservation status of species, comes from data sets provided by collecting institutions, individual collectors and community groups. These data sets are listed on this page.
2727
public.datasets.header.message03=Refine the list of data sets by clicking on a filter in the left hand list. Click the
2828
public.datasets.header.message04=toggle to see a description of the data set. To find out more, go to the data set's full metadata page by clicking on its name
@@ -99,7 +99,7 @@ public.purpose=Purpose
9999
public.geographicDescription = Geographic Description
100100
public.methodStepDescription = Methods
101101
public.location=Location
102-
public.website=Web site
102+
public.website=Website
103103
public.numbrs.des01=Looking up... the number of records that
104104
public.numbrs.des02=can be accessed through the {0}
105105
public.numbrs.link=Click to view records for the
@@ -198,8 +198,10 @@ public.sdr.content.link01=Click to view records for the
198198
public.sdr.content.link02=resource
199199
public.sdr.content.label10=Map of records
200200
public.sdr.content.label12=Species lists
201+
public.sdr.content.label13=Publication details
201202
public.sdr.content.link03=View this species list in species list tool
202203
public.sdr.content.link04=Visit the data resource's website
204+
public.sdr.content.link05=Visit the publication's website
203205
public.sdr.infosourcelist.title=Contributors to this page
204206
public.sdr.externalIdentifiers.title=Other Identifiers
205207
@@ -526,6 +528,7 @@ collection.acronym.label=Acronym
526528
collection.resourceType.label=Resource type
527529
collection.institution.label=Institution
528530
collection.gbifDoi.label=DOI
531+
collection.isPrivate.label=Is private ?
529532
dataprovider.gbif.country=GBIF Attribution
530533

531534
dataResource.dataProvider.label=Data provider
@@ -1091,6 +1094,7 @@ dataresource.show.sor=Source of records
10911094
dataresource.show.guid=GUID
10921095
dataresource.show.doi=DOI
10931096
dataresource.show.resourcetype=Resource type
1097+
dataresource.show.isprivate=Is private
10941098
dataresource.show.website=Website
10951099
dataresource.show.dg=Data generalisations
10961100
dataresource.show.iw=Information withheld
@@ -1710,7 +1714,6 @@ licence.url.list.label=URL
17101714
licence.acronym.list.label=Acronym
17111715
licence.version.list.label=Version
17121716
licence.image.list.label=Image
1713-
licence.name.label=Name
17141717
licence.acronym.label=Acronym
17151718
licence.version.label=Version
17161719
licence.url.label=URL
@@ -1862,6 +1865,7 @@ metadata.last.updated=Metadata last updated on
18621865
18631866
dataAccess.title=Data access
18641867
dataAccess.view.records=View records
1868+
dataAccess.view.annotated.records=View referenced records
18651869
dataAccess.download.stats=Download usage stats
18661870
dataAccess.download.records=Download records
18671871
dataAccess.alert.records=Create an email alert for new records for
@@ -2109,9 +2113,6 @@ datasets.js.appendresource10=View records
21092113
datasets.js.appendresource11=Website
21102114
datasets.js.appendresource09=Content includes
21112115
2112-
datasets.js.lastUpdated=Last updated
2113-
datasets.js.numRecords=Records
2114-
21152116
datasets.js.updatetotal03=Showing
21162117
datasets.js.updatetotal04=data
21172118
datasets.js.updatetotal05=set.
@@ -2251,6 +2252,9 @@ dataset.result.records = records
22512252
dataset.result.species-list = species-list
22522253
dataset.result.website = website
22532254
dataset.result.document = document
2255+
dataset.result.annotations = annotations
2256+
dataset.result.events = events
2257+
dataset.result.publications = publication
22542258
public.datasets.search.btn.title=Only show data sets which contain the search term
22552259
citations.available = citations for these data
22562260
collectory.tag.lib.the.collection.was.established.in=The collection was established in {0} and ceased acquisitions in {1}.
@@ -2288,4 +2292,22 @@ collectory.tag.lib.states.covered.include=States covered include: {0}.
22882292
public.show.collection.has.an.estimated=has an estimated {0} {1}
22892293
public.show.percent.over=over 100
22902294
images.available.count={0} images
2291-
images.available.count.available=have been made available from the {0}.
2295+
images.available.count.available=have been made available from the {0}.
2296+
2297+
resourceType.publications.list=Publications
2298+
resourceType.annotations.list=Annotations
2299+
resourceType.records.list=Occurrences
2300+
resourceType.events.list=Events
2301+
resourceType.species-list.list=Species lists
2302+
2303+
resourceType.publications=Publication
2304+
resourceType.annotations=Annotations dataset
2305+
resourceType.records=Occurrence dataset
2306+
resourceType.events=Events based data
2307+
resourceType.species-list=Species list
2308+
2309+
resourceType.publications.description=This publication references data from other datasets (occurrence or event based datasets). It may also include some modifications to the data as it is presented by the Atlas.
2310+
resourceType.annotations.description=This dataset references data from other datasets (occurrence or event based datasets). It may also include some modifications to the data as it is presented by the Atlas.
2311+
resourceType.records.description=This dataset that contains primary occurrence data for species.
2312+
resourceType.events.description=This dataset that contains event based data for species which may include sampling information
2313+
resourceType.species-list.description=This dataset contains a list of species with an associated trait.

Diff for: grails-app/views/dataResource/show.gsp

+7-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
<li class="btn btn-default"><span class="glyphicon glyphicon-plus"></span><g:link class="create" action="create"> <g:message code="default.new.label" args="[entityName]"/></g:link></li>
3535
</ul>
3636
<ul class="btn-group pull-right">
37-
<li class="btn btn-default"><cl:viewPublicLink uid="${instance?.uid}"/></li>
37+
<g:if test="${!instance?.isPrivate}">
38+
<li class="btn btn-default"><cl:viewPublicLink uid="${instance?.uid}"/></li>
39+
</g:if>
3840
<li class="btn btn-default"><cl:jsonSummaryLink uid="${instance.uid}"/></li>
3941
<li class="btn btn-default"><cl:jsonDataLink uid="${instance.uid}"/></li>
4042
<li class="btn btn-default"><cl:emlDataLink uid="${instance.uid}"/></li>
@@ -76,6 +78,10 @@
7678
<!-- type -->
7779
<p><span class="category"><g:message code="dataresource.show.resourcetype" />: </span> ${fieldValue(bean: instance, field: "resourceType")}</p>
7880

81+
<!-- is private -->
82+
<p><span class="category"><g:message code="dataresource.show.isprivate" />: </span> ${fieldValue(bean: instance, field: "isPrivate")}</p>
83+
84+
7985
<!-- Web site -->
8086
<p><span class="category"><g:message code="dataresource.show.website" />: </span> <cl:externalLink href="${fieldValue(bean:instance, field:'websiteUrl')}"/></p>
8187

Diff for: grails-app/views/public/_dataLinks.gsp

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<%@ page import="au.org.ala.collectory.CollectoryTagLib" %>
2+
<div class="public-metadata">
3+
<h4><g:message code="dataAccess.title"/></h4>
4+
<div class="dataAccess btn-group-vertical">
5+
<a href="${grailsApplication.config.biocacheUiURL}/occurrences/search?fq=annotationsUid:${instance.uid}" class="btn btn-default">
6+
<i class="glyphicon glyphicon-list"></i> <g:message code="dataAccess.view.annotated.records"/></a>
7+
</div>
8+
</div>

Diff for: grails-app/views/public/showDataResource.gsp

+38-6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
<meta name="breadcrumbParent"
88
content="${createLink(action: 'datasets', controller: 'public')},${message(code: 'breadcrumb.datasets')}"
99
/>
10+
<meta name="breadcrumbs"
11+
content="${createLink(action: 'datasets', controller: 'public')}#filters=resourceType:${instance.resourceType},${message(code: 'resourceType.' + instance.resourceType + '.list')}"
12+
/>
1013
<title>${fieldValue(bean: instance, field: "name")}</title>
1114
<script type="text/javascript">
1215
var COLLECTORY_CONF = {
@@ -42,7 +45,7 @@
4245
<div class="tabbable">
4346
<ul class="nav nav-tabs" id="home-tabs">
4447
<li class="active"><a href="#basicMetadata" data-toggle="tab"><g:message code="show.tab.metadata" /></a></li>
45-
<g:if test="${instance.resourceType=='records'}">
48+
<g:if test="${instance.resourceType=='records' || instance.resourceType=='events'}">
4649
<li><a href="#usage-stats" data-toggle="tab"><g:message code="show.tab.usage.stats" /></a></li>
4750
<li><a href="#metrics" data-toggle="tab"><g:message code="show.tab.metrics" /></a></li>
4851
</g:if>
@@ -51,6 +54,12 @@
5154

5255
<div class="tab-content">
5356
<div id="basicMetadata" class="tab-pane active">
57+
58+
<h3 class="dataResourceProviderLink">Dataset type</h3>
59+
<p>
60+
<g:message code="resourceType.${instance.resourceType}.description" default="${instance.resourceType}" />
61+
</p>
62+
5463
<g:if test="${instance.pubDescription || instance.techDescription || instance.focus}">
5564
<h3><g:message code="public.des" /></h3>
5665
</g:if>
@@ -138,7 +147,7 @@
138147
<cl:dataCurrency date="${instance.dataCurrency}"/></p>
139148
</g:if>
140149

141-
<g:if test="${instance.resourceType == 'records'}">
150+
<g:if test="${instance.resourceType == 'records' || instance.resourceType=='events'}">
142151
<h2><g:message code="public.sdr.content.label09" /></h2>
143152
<div>
144153
<p><span
@@ -155,7 +164,7 @@
155164
<cl:lastUpdated date="${instance.lastUpdated}"/>
156165
</div>
157166

158-
<g:if test="${!grailsApplication.config.disableLoggerLinks.toBoolean() && (instance.resourceType == 'website' || instance.resourceType == 'records')}">
167+
<g:if test="${!grailsApplication.config.disableLoggerLinks.toBoolean() && (instance.resourceType == 'website' || instance.resourceType == 'records' || instance.resourceType=='events')}">
159168
<div id="usage-stats" class="tab-pane">
160169
<div id='usage'>
161170
<p><g:message code="public.usage.des" />...</p>
@@ -166,7 +175,7 @@
166175
</div>
167176
</g:if>
168177

169-
<g:if test="${instance.resourceType == 'records'}">
178+
<g:if test="${instance.resourceType == 'records' || instance.resourceType=='events' || instance.resourceType=='publications'}">
170179
<div id="metrics" class="section vertical-charts tab-pane">
171180
<div id="charts"></div>
172181
</div>
@@ -186,6 +195,10 @@
186195
<img class="institutionImage" src='${resource(absolute:"true", dir:"data/dataResource/",file:instance.logoRef.file)}' />
187196
</g:elseif>
188197

198+
<section class="public-metadata">
199+
<h3><g:message code="resourceType.${instance.resourceType}" default="${instance.resourceType}"/></h3>
200+
</section>
201+
189202
<g:if test="${fieldValue(bean: instance, field: 'imageRef') && fieldValue(bean: instance, field: 'imageRef.file')}">
190203
<section>
191204
<img alt="${fieldValue(bean: instance, field: "imageRef.file")}"
@@ -199,6 +212,10 @@
199212
</section>
200213
</g:if>
201214

215+
<g:if test="${instance.resourceType == "publications"}">
216+
<g:render template="dataLinks" model="[instance:instance]"/>
217+
</g:if>
218+
202219
<div id="dataAccessWrapper" style="display:none;">
203220
<g:render template="dataAccess" model="[instance:instance]"/>
204221
</div>
@@ -229,7 +246,7 @@
229246
<g:if test="${instance.licenseType}">
230247
<section class="public-metadata">
231248
<h4><g:message code="public.license" default="Licence" /></h4>
232-
<p><cl:displayLicenseType type="${instance.licenseType}" version="${instance.licenseVersion}"/></p>
249+
<p style="margin-top: 10px; margin-bottom:10px;"><cl:displayLicenseType type="${instance.licenseType}" version="${instance.licenseVersion}"/></p>
233250
</section>
234251
</g:if>
235252

@@ -294,6 +311,15 @@
294311
</div>
295312
</section>
296313
</g:if>
314+
<g:elseif test="${instance.resourceType == 'publications'}">
315+
<section class="public-metadata">
316+
<h4><g:message code="public.website" /></h4>
317+
<div class="webSite">
318+
<a class='external_icon' target="_blank"
319+
href="${instance.websiteUrl}"><g:message code="public.sdr.content.link05" /></a>
320+
</div>
321+
</section>
322+
</g:elseif>
297323
<g:elseif test="${instance.websiteUrl}">
298324
<section class="public-metadata">
299325
<h4><g:message code="public.website" /></h4>
@@ -355,7 +381,13 @@
355381
}
356382
}
357383
</asset:script>
358-
<g:render template="charts" model="[facet:'data_resource_uid', instance: instance]" />
384+
385+
<g:if test="${instance.resourceType == 'records' || instance.resourceType == 'events'}">
386+
<g:render template="charts" model="[facet:'dataResourceUid', instance: instance]" />
387+
</g:if>
388+
<g:if test="${instance.resourceType == 'publications'}">
389+
<g:render template="charts" model="[facet:'annotationsUid', instance: instance]" />
390+
</g:if>
359391
</div>
360392
</div>
361393

Diff for: grails-app/views/shared/base.gsp

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343

4444
</div>
4545
<g:if test="${command.ENTITY_TYPE == 'DataResource'}">
46+
<div class="form-group">
47+
<label for="isPrivate"><g:message code="collection.isPrivate.label" default="isPrivate"/></label>
48+
<g:checkBox name="isPrivate" value="${command?.isPrivate}"/>
49+
</div>
4650
<div class="form-group">
4751
<label for="gbifDoi"><g:message code="collection.gbifDoi.label" default="DOI"/></label>
4852
<g:textField name="gbifDoi" class="form-control" maxlength="45" value="${command?.gbifDoi}" />

0 commit comments

Comments
 (0)