Skip to content

Commit

Permalink
#457 Dublin Core Related Resources
Browse files Browse the repository at this point in the history
  • Loading branch information
josegar74 committed Apr 24, 2014
1 parent 737d537 commit 157dfa9
Show file tree
Hide file tree
Showing 33 changed files with 2,541 additions and 73 deletions.
3 changes: 3 additions & 0 deletions core/src/main/java/org/fao/geonet/kernel/XmlSerializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ private void xpath(StringBuilder buffer, Element next) {
public static void removeFilteredElement(Element metadata,
final Pair<String, Element> xPathAndMarkedElement,
List<Namespace> namespaces) throws JDOMException {
// xPathAndMarkedElement seem can be null in some schemas like dublin core
if (xPathAndMarkedElement == null) return;

String xpath = xPathAndMarkedElement.one();
Element mark = xPathAndMarkedElement.two();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@

gnOnlinesrc.register('onlinesrc', function() {
scope.metadataId = gnCurrentEdit.id;
scope.schema = gnCurrentEdit.schema;

$(scope.popupid).modal('show');

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@
*
* @param {string} type of the directive that calls it.
*/
onOpenPopup: function(type) {
openCb[type]();
onOpenPopup: function(type, additionalParams) {
openCb[type](additionalParams);
},

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<label for="onlinesrcUrl" class="col-sm-2 control-label"
data-translate="">url</label>
<div class="col-sm-10">
<input ng-model="params.url" class="" type="text"
<input data-ng-model="params.url" class="" type="text"
id="onlinesrcUrl" placeholder="http://">
</div>
</div>
Expand Down Expand Up @@ -59,7 +59,7 @@
</div>

<!-- Name text Field -->
<div class="form-group" data-ng-show="mode == 'url'">
<div class="form-group" data-ng-show="mode == 'url' && schema !== 'dublin-core'">
<label for="onlinesrcName" class="col-sm-2 control-label">Name</label>
<div class="col-sm-10">
<input ng-model="params.name" name="name" class="" type="text"
Expand All @@ -68,7 +68,7 @@
</div>

<!-- Protocol Combo -->
<div class="form-group" data-ng-show="mode == 'url'">
<div class="form-group" data-ng-show="mode == 'url' && schema !== 'dublin-core'">
<label for="protocol" class="col-sm-2 control-label">
<span data-translate="">Protocol</span>
</label>
Expand All @@ -78,7 +78,7 @@
</div>

<!-- Description Text area -->
<div class="form-group">
<div class="form-group" data-ng-hide="schema === 'dublin-core'">
<label for="onlinesrcDescr" class="col-sm-2 control-label">Description</label>
<div class="col-sm-10">
<textarea rows="3" ng-model="params.desc"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<a href="" data-ng-click="onlinesrcService.onOpenPopup('onlinesrc')"> <i class="fa fa-link"></i>
<i class="icon-external-link"></i> <span data-translate="">addOnlinesrc</span>
</a></li>

<li class="divider"
data-ng-show="isCategoryEnable('thumbnail') || isCategoryEnable('onlinesrc')"></li>
<li data-ng-show="isCategoryEnable('parent')"><a href=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@
mdOtherLanguages: getInputValue('otherLanguages'),
showValidationErrors: getInputValue('showvalidationerrors'),
uuid: getInputValue('uuid'),
schema: getInputValue('schema'),
version: getInputValue('version'),
geoPublisherConfig:
angular.fromJson(getInputValue('geoPublisherConfig')),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ INSERT INTO Settings (name, value, datatype, position, internal) VALUES
('map/proj4js', '[{"code":"EPSG:2154","value":"+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"}]', 0, 9591, 'n');

INSERT INTO Settings (name, value, datatype, position, internal) VALUES
('metadata/editor/schemaConfig', '{"iso19110":{"defaultTab":"default","displayToolTip":false,"related":{"display":true,"readonly":true,"categories":["dataset"]},"validation":{"display":true}},"iso19139":{"defaultTab":"default","displayToolTip":false,"related":{"display":true,"categories":[]},"suggestion":{"display":true},"validation":{"display":true}},"dublin-core":{"defaultTab":"default","related":{"display":true,"readonly":false,"categories":["parent"]}}}', 0, 10000, 'n');
('metadata/editor/schemaConfig', '{"iso19110":{"defaultTab":"default","displayToolTip":false,"related":{"display":true,"readonly":true,"categories":["dataset"]},"validation":{"display":true}},"iso19139":{"defaultTab":"default","displayToolTip":false,"related":{"display":true,"categories":[]},"suggestion":{"display":true},"validation":{"display":true}},"dublin-core":{"defaultTab":"default","related":{"display":true,"readonly":false,"categories":["parent","onlinesrc"]}}}', 0, 10000, 'n');

INSERT INTO HarvesterSettings (id, parentid, name, value) VALUES (1,NULL,'harvesting',NULL);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ INSERT INTO Settings (name, value, datatype, position, internal) VALUES
INSERT INTO Settings (name, value, datatype, position, internal) VALUES
('map/proj4js', '[{"code":"EPSG:2154","value":"+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"}]', 0, 9591, 'n');
INSERT INTO Settings (name, value, datatype, position, internal) VALUES
('metadata/editor/schemaConfig', '{"iso19110":{"defaultTab":"default","displayToolTip":false,"related":{"display":true,"readonly":true,"categories":["dataset"]},"validation":{"display":true}},"iso19139":{"defaultTab":"inspire","displayToolTip":false,"related":{"display":true,"categories":[]},"suggestion":{"display":true},"validation":{"display":true}},"dublin-core":{"defaultTab":"default","related":{"display":true,"readonly":false,"categories":["parent"]},}}', 0, 10000, 'n');
('metadata/editor/schemaConfig', '{"iso19110":{"defaultTab":"default","displayToolTip":false,"related":{"display":true,"readonly":true,"categories":["dataset"]},"validation":{"display":true}},"iso19139":{"defaultTab":"inspire","displayToolTip":false,"related":{"display":true,"categories":[]},"suggestion":{"display":true},"validation":{"display":true}},"dublin-core":{"defaultTab":"default","related":{"display":true,"readonly":false,"categories":["parent","onlinesrc"]},}}', 0, 10000, 'n');


ALTER TABLE StatusValues ADD displayorder int;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="xml.xsd"/>

<!--xs:import namespace="http://purl.org/dc/terms/"
schemaLocation="dcterms.xsd"/-->
<xs:import namespace="http://purl.org/dc/terms/"
schemaLocation="dcterms.xsd"/>


<xs:complexType name="SimpleLiteral">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template mode="relation" match="metadata[simpledc]" priority="99">
<xsl:for-each select="*/descendant::*[name(.) = 'dct:references'][starts-with(., 'http') or contains(. , 'resources.get') or contains(., 'file.disclaimer')]">
<relation type="onlinesrc">
<id><xsl:value-of select="."/></id>
<title>
<xsl:value-of select="."/>
</title>
<url>
<xsl:value-of select="."/>
</url>
<name>
<xsl:value-of select="."/>
</name>
<abstract><xsl:value-of select="."/></abstract>
<description><xsl:value-of select="."/></description>
<xsl:choose>
<xsl:when test="contains(. , 'resources.get') or contains(., 'file.disclaimer')">
<protocol><xsl:value-of select="'WWW:DOWNLOAD-1.0-http--download'"/></protocol>
</xsl:when>
<xsl:otherwise>
<protocol><xsl:value-of select="'WWW:LINK-1.0-http--link'"/></protocol>
</xsl:otherwise>
</xsl:choose>
</relation>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
</xsl:template>


<!-- Hide from the editor the dct:references pointing to uploaded files -->
<xsl:template mode="mode-dublin-core" priority="101" match="dct:references[starts-with(., 'http') or contains(. , 'resources.get') or contains(., 'file.disclaimer')]" />


<!-- the other elements in DC. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,150 @@
<label>Rights Holder</label>
<description>A person or organization owning or managing rights over the resource.</description>
</element>
<!-- ==================================================== -->
<!-- ==================================================== -->
<element name="dct:references">
<label>Related resource</label>
<description>A related resource that is referenced, cited, or otherwise pointed to by the described resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:accessRights">
<label>Access Rights</label>
<description>Information about who can access the resource or an indication of its security status.</description>
</element>
<!-- ==================================================== -->
<element name="dct:alternative">
<label>Alternative Title</label>
<description>An alternative name for the resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:bibliographicCitation">
<label>Bibliographic Citation</label>
<description>A bibliographic reference for the resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:conformsTo">
<label>Conforms To</label>
<description>An established standard to which the described resource conforms.</description>
</element>
<!-- ==================================================== -->
<element name="dct:created">
<label>Date Created</label>
<description>Date of creation of the resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:dateAccepted">
<label>Date Accepted</label>
<description>Date of acceptance of the resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:dateCopyrighted">
<label>Date Copyrighted</label>
<description>Date of copyright.</description>
</element>
<!-- ==================================================== -->
<element name="dct:dateSubmitted">
<label>Date Submitted</label>
<description>Date of submission of the resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:educationLevel">
<label>Audience Education Level</label>
<description>A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended.</description>
</element>
<!-- ==================================================== -->
<element name="dct:extent">
<label>Extent</label>
<description>The size or duration of the resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:hasFormat">
<label>Has Format</label>
<description>A related resource that is substantially the same as the pre-existing described resource, but in another format.</description>
</element>
<!-- ==================================================== -->
<element name="dct:hasPart">
<label>Has Part</label>
<description>A related resource that is included either physically or logically in the described resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:hasVersion">
<label>Has Version</label>
<description>A related resource that is a version, edition, or adaptation of the described resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:isFormatOf">
<label>Is Format Of</label>
<description>A related resource that is substantially the same as the described resource, but in another format.</description>
</element>
<!-- ==================================================== -->
<element name="dct:isPartOf">
<label>Is Part Of</label>
<description>A related resource in which the described resource is physically or logically included.</description>
</element>
<!-- ==================================================== -->
<element name="dct:isReferencedBy">
<label>Is Referenced By</label>
<description>A related resource that references, cites, or otherwise points to the described resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:isReplacedBy">
<label>Is Replaced By</label>
<description>A related resource that supplants, displaces, or supersedes the described resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:isRequiredBy">
<label>Is Required By</label>
<description>A related resource that requires the described resource to support its function, delivery, or coherence.</description>
</element>
<!-- ==================================================== -->
<element name="dct:isVersionOf">
<label>Is Version Of</label>
<description>A related resource of which the described resource is a version, edition, or adaptation.</description>
</element>
<!-- ==================================================== -->
<element name="dct:issued">
<label>Date Issued</label>
<description>Date of formal issuance (e.g., publication) of the resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:license">
<label>License</label>
<description>A legal document giving official permission to do something with the resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:mediator">
<label>Mediator</label>
<description>An entity that mediates access to the resource and for whom the resource is intended or useful.</description>
</element>
<!-- ==================================================== -->
<element name="dct:medium">
<label>Medium</label>
<description>The material or physical carrier of the resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:replaces">
<label>Replaces</label>
<description>A related resource that is supplanted, displaced, or superseded by the described resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:requires">
<label>Requires</label>
<description>A related resource that is required by the described resource to support its function, delivery, or coherence.</description>
</element>
<!-- ==================================================== -->
<element name="dct:tableOfContents">
<label>Table Of Contents</label>
<description>A list of subunits of the resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:temporal">
<label>Temporal Coverage</label>
<description>Temporal characteristics of the resource.</description>
</element>
<!-- ==================================================== -->
<element name="dct:valid">
<label>Date Valid</label>
<description>Date (often a range) of validity of a resource.</description>
</element>
<!-- ==================================================== -->
</labels>
Loading

0 comments on commit 157dfa9

Please sign in to comment.