Skip to content

Commit

Permalink
online res : set layer title as description for wms-getmap
Browse files Browse the repository at this point in the history
  • Loading branch information
fgravin committed Aug 30, 2013
1 parent 96b8488 commit a533b79
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,13 @@ GeoNetwork.editor.LinkResourcesWindow = Ext.extend(Ext.Window, {
listeners: {
rowselect: {
fn: function(sm, rowIndex, record) {
this.layerNames.push(record.get('name'));
this.layerNames.push(record);
},
scope : this
},
rowdeselect: {
fn: function(sm, rowIndex, record) {
this.layerNames.splice(this.layerNames.indexOf(record.get('name')),1);
this.layerNames.remove(record);
},
scope: this
}
Expand Down Expand Up @@ -1092,7 +1092,16 @@ GeoNetwork.editor.LinkResourcesWindow = Ext.extend(Ext.Window, {
// Define which metadata to be modified
// It could be the on in current editing or a related one
var targetMetadataUuid = this.metadataUuid, parameters = "";
this.layerName = this.layerNames.join(',');
this.layerName = '';
var layerTitle = '';

Ext.each(this.layerNames, function(rec) {
this.layerName += rec.get('name') + ',';
layerTitle += rec.get('title') + ',';
}, this);

this.layerName = this.layerName.substring(this.layerName, this.layerName.length-1);
layerTitle = layerTitle.substring(layerTitle, layerTitle.length-1);

if (this.type === 'parent') {
// Define the parent metadata record to link to
Expand Down Expand Up @@ -1137,7 +1146,7 @@ GeoNetwork.editor.LinkResourcesWindow = Ext.extend(Ext.Window, {
// Add a link in the distribution section of the dataset record
parameters += "&uuidref=" + this.selectedMd;
parameters += "&scopedName=" + this.layerName;
parameters += "&desc=" + this.layerName;
parameters += "&desc=" + layerTitle;
parameters += "&url=" + this.serviceUrl;
parameters += "&protocol=" + this.serviceProtocol;
} else if (this.type === 'dataset') {
Expand All @@ -1147,7 +1156,7 @@ GeoNetwork.editor.LinkResourcesWindow = Ext.extend(Ext.Window, {
var serviceUpdateUrl = this.catalogue.services.mdProcessingXml +
"?uuid=" + this.selectedMd +
"&process=onlinesrc-add" +
"&desc=" + this.layerName +
"&desc=" + layerTitle +
"&url=" + this.serviceUrl +
"&uuidref=" + targetMetadataUuid +
"&name=" + this.layerName;
Expand Down Expand Up @@ -1211,16 +1220,18 @@ GeoNetwork.editor.LinkResourcesWindow = Ext.extend(Ext.Window, {
} else {
parameters += "&extra_metadata_uuid=" + (this.selectedMd ? this.selectedMd : "");
if (this.selectedLink.href) {
var name, url;
var name, url, desc;
if(this.isGetMap(this.selectedLink.protocol)) {
name = this.layerName;
url = encodeURIComponent(this.selectedLink.href.split('?')[0]);
desc = layerTitle;
} else {
name = this.selectedLink.name;
url = encodeURIComponent(this.selectedLink.href);
desc = this.selectedLink.title;
}
parameters += "&url=" + url +
"&desc=" + this.selectedLink.title +
"&desc=" + desc +
"&protocol=" + this.selectedLink.protocol +
"&name=" + name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ attached it to the metadata for data.
</xsl:if>
<xsl:if test="$url">
<xsl:for-each select="tokenize($name, ',')">
<xsl:variable name="pos" select="position()"/>
<gmd:onLine>
<xsl:if test="$uuidref">
<xsl:attribute name="uuidref" select="$uuidref"/>
Expand All @@ -103,7 +104,7 @@ attached it to the metadata for data.
</gmd:name>
<gmd:description>
<gco:CharacterString>
<xsl:value-of select="."/>
<xsl:value-of select="tokenize($desc, ',')[position() = $pos]"/>
</gco:CharacterString>
</gmd:description>
</gmd:CI_OnlineResource>
Expand Down

0 comments on commit a533b79

Please sign in to comment.