Ticket #291 (closed defect: fixed)
[M] Unescaped ampersands in CEDAR DIF
Reported by: | lawrence | Owned by: | lawrence |
---|---|---|---|
Priority: | critical | Milestone: | Replace Metadata Gateway |
Component: | discovery | Version: | |
Keywords: | DiscoveryService | Cc: |
Description (last modified by selatham) (diff)
Our CEDAR DIF records might contain & in the urls (for A-services ... but maybe elsewhere). These need escaping appropriately (&) ... and corresponding service binding code may also need modification.
Change History
comment:1 Changed 14 years ago by selatham
- Status changed from new to assigned
- Description modified (diff)
comment:2 Changed 14 years ago by ko23
In which fields? Note that if you escape ampersands/URLs/etc., then you need to unescape them consistently later, even if one uses the standard functions.
comment:3 Changed 14 years ago by selatham
If they are not escaped then they won't go into exist. So we need to do something.
comment:4 Changed 14 years ago by selatham
- Keywords XSLT removed
- Milestone changed from PreBeta to BETA
- Summary changed from [M] Unescaped ampersands in DIF to [M] Unescaped ampersands in CEDAR DIF
This is linked to service binding issues.
comment:5 Changed 14 years ago by selatham
- Milestone changed from BETA to BETA+Services
We've changed our service binding to late-binding so may not be such a problem. But could still happen. Need to think it through.
comment:7 Changed 13 years ago by selatham
- Milestone changed from PROD Step2 to PROD Final
service binding has gone back to early-binding, so could be a problem.
comment:8 Changed 13 years ago by selatham
- Owner changed from selatham to lawrence
- Status changed from assigned to new
- Component changed from T01_Discovery to DiscoveryService
- Milestone changed from PROD Final to Replace Metadata Gateway
Ampersands are being escaped in URLs now when creating MOLES/DIF XML. This IS causing a problem following links. e.g. any neodc record http://www.neodc.rl.ac.uk/?option=displaypage&Itemid=132&op=page&SubMenu=-1
comment:9 Changed 13 years ago by spascoe
Does this issue effect all DIFs ingested into the DiscoveryService? or only those created by BADC?
I think ampersands need to be escaped in element bodies in order to be valid XML, therefore DIF consumers (such as the NERC-Portals portal) will just need to deal with unescaping &
Note the DIF provided by Jon Blower for NERC-Portals already has "&" escaped correctly.
comment:10 Changed 13 years ago by selatham
- Priority changed from desirable to critical
Actually you can see that Jon's record has escaped ampersands. I was only using the neodc record as an example which I had noticed. I'm assuming escaped things in URLs in general aren't being handled properly by the NDG Discovery/Browse? front-end.i.e. we need to unescape on display. But as NERC Portals are only using the SOAP WS then they will just get the XML records and deal with unescaping themselves. So I think it's really only a problem for our front-end.
comment:11 Changed 13 years ago by lawrence
- Status changed from new to closed
- Resolution set to fixed
Well, I've hacked a fix into changeset:3159. Good enough for now.
comment:12 Changed 12 years ago by lawrence
- Keywords DiscoveryService added; service_binding removed
- Component changed from DiscoveryService to discovery
Moved from DiscoveryService? component to discovery as part of NDG2 cleanup
ampersands are being escaped in descriptions. Need to do this in URLs too.