Dspace-RIUFJF
Dspace-RIUFJF

Reputation: 35

How can I hide metadata fields in page source code?

I've found out that certain metadata fields, that have personal details, are being shown in the source code of my item page as metadata xml, is there any way to hide them? I did set the "metadata.hide.[...]" field in my configurations file to hide these values. Thanks in advance.

this is my metadata.hide, it works fine and these fields doesn't show in the full item record, mets,etc, to normal users, they do appear in the source code for google metadata though.

metadata.hide.dc.creator.ID = true
metadata.hide.dc.contributor.advisor1ID = true
metadata.hide.dc.contributor.advisor1ID = true
metadata.hide.dc.contributor.advisor2ID = true
metadata.hide.dc.contributor.advisor-co1ID = true
metadata.hide.dc.contributor.advisor-co2ID = true
metadata.hide.dc.contributor.referee1ID = true
metadata.hide.dc.contributor.referee2ID = true
metadata.hide.dc.contributor.referee3ID = true
metadata.hide.dc.contributor.referee4ID = true
metadata.hide.dc.contributor.referee5ID = true

new edit: xhtml-head-item.properties:

    dc.contributor                 = DC.contributor
    dc.contributor.author          = DC.creator
    dc.coverage.spatial            = DCTERMS.spatial
    dc.coverage.temporal           = DCTERMS.temporal
    dc.creator                     = DC.creator
    dc.date                        = DC.date,DCTERMS.W3CDTF
    dc.date.accessioned            = DCTERMS.dateAccepted,DCTERMS.W3CDTF
    dc.date.available              = DCTERMS.available,DCTERMS.W3CDTF
    dc.date.copyright              = DCTERMS.dateCopyrighted,DCTERMS.W3CDTF
    dc.date.created                = DCTERMS.created,DCTERMS.W3CDTF
    dc.date.issued                 = DCTERMS.issued,DCTERMS.W3CDTF
    dc.identifier                  = DC.identifier
    dc.identifier.citation         = DCTERMS.bibliographicCitation
    dc.identifier.uri              = DC.identifier,DCTERMS.URI
    dc.description                 = DC.description
    dc.description.abstract        = DCTERMS.abstract
    dc.description.tableofcontents = DCTERMS.tableOfContents
    dc.description.uri             = DC.description,DCTERMS.URI
    dc.format                      = DC.format
    dc.format.extent               = DCTERMS.extent
    dc.format.medium               = DCTERMS.medium
    dc.language                    = DC.language
    dc.language.iso                = DC.language,DCTERMS.RFC1766
    dc.publisher                   = DC.publisher
    dc.relation                    = DC.relation
    dc.relation.isformatof         = DCTERMS.isFormatOf
    dc.relation.ispartof           = DCTERMS.isPartOf
    dc.relation.haspart            = DCTERMS.hasPart
    dc.relation.isversionof        = DCTERMS.isVersionOf
    dc.relation.hasversion         = DCTERMS.hasVersion
    dc.relation.isreferencedby     = DCTERMS.isReferencedBy
    dc.relation.requires           = DCTERMS.requires
    dc.relation.replaces           = DCTERMS.replaces
    dc.relation.isreplacedby       = DCTERMS.isReplacedBy
    dc.relation.uri                = DC.relation,DCTERMS.URI
    dc.rights                      = DC.relation
    dc.rights.uri                  = DC.rights,DCTERMS.URI
    dc.source                      = DC.source
    dc.source.uri                  = DC.source,DCTERMS.URI
    dc.subject                     = DC.subject
    dc.subject.ddc                 = DC.subject,DCTERMS.DDC
    dc.subject.lcc                 = DC.subject,DCTERMS.LCC
    dc.subject.lcsh                = DC.subject,DCTERMS.LCSH
    dc.subject.mesh                = DC.subject,DCTERMS.MESH
    dc.title                       = DC.title
    dc.title.alternative           = DCTERMS.alternative
    dc.type                        = DC.type

google-metadata.properties:

google.identifiers.dissertation = dc.type:Thesis
google.identifiers.patent = dc.type:Patent
google.identifiers.technical_report = dc.type:Technical Report

google.citation_title = dc.title
google.citation_publisher = dc.publisher
google.citation_author = dc.author | dc.contributor.author | dc.creator
google.citation_date = dc.date.copyright | dc.date.issued | dc.date.available | dc.date.accessioned
google.citation_language = dc.language.iso
google.citation_pmid =
google.citation_abstract_html_url = $handle
google.citation_fulltext_html_url =
google.citation_pdf_url = $simple-pdf
google.citation_keywords = dc.subject, dc.type

google.citation_journal_title =
google.citation_volume =
google.citation_issue =
google.citation_firstpage =
google.citation_lastpage =
google.citation_doi =
google.citation_issn = dc.identifier.issn
google.citation_isbn = dc.identifier.isbn
google.citation_conference = 

google.citation_dissertation_name = dc.title
google.citation_dissertation_institution = dc.publisher

google.citation_patent_country = 
google.citation_patent_number = 

google.citation_technical_report_number =
google.citation_technical_report_institution = dc.publisher

google.citation.prioritized_types = Adobe PDF, Postscript, Microsoft Word XML, Microsoft Word, RTF, EPUB

in the image this link takes to, it shows how they look like in the page source code. I've hidden the values.

Upvotes: 2

Views: 1078

Answers (1)

David_cav
David_cav

Reputation: 81

In theory, setting the metadata.hide.[metadata schema].[metadata element].[metadata qualifier] = true in dspace.cfg should hide the corresponding metadata field from the mets xml page for non-admin users.

I have tried it on a DSpace 6.3. codebase (https://demo.dspace.org/xmlui/). When opening this page https://demo.dspace.org/xmlui/metadata/handle/10673/7/mets.xml :

  • As an anonymous user -> I'm not able to see dc.description.provenance which is configured as a "metadata.hide field" in dspace.cfg

  • As an admin user -> I'm able to see dc.description.provenance

By searching on the Duraspace Jira, I did not find other complains about this issue, except maybe https://jira.duraspace.org/browse/DS-3355 .

I did not understand at first that you were referring to the page source code. In the link you provided (view-source:http://demo.dspace.org/jspui/handle/10673/6), I can't find the metadata dc.description.provenance which is configured as a "metadata.hide" metadata.

If you refer to metadata tags like meta name="DC.creator" or meta name="citation_keywords", it might be that the private metadata you are trying to hide has been configured in the metadata which should appear in the HTML head. Please check this documentation : https://wiki.duraspace.org/display/DSDOC5x/Search+Engine+Optimization#SearchEngineOptimization-EnsureItemMetadataappearsintheHTMLHEAD

You might especially want to check if your private metadata has not been defined in one of the following files : [dspace]/config/crosswalks/xhtml-head-item.properties [dspace]/config/crosswalks/google-metadata.properties

Upvotes: 1

Related Questions