{"action":"created","issue":{"url":"https://api.github.com/repos/GeoNode/geonode/issues/2187","labels_url":"https://api.github.com/repos/GeoNode/geonode/issues/2187/labels{/name}","comments_url":"https://api.github.com/repos/GeoNode/geonode/issues/2187/comments","events_url":"https://api.github.com/repos/GeoNode/geonode/issues/2187/events","html_url":"https://github.com/GeoNode/geonode/issues/2187","id":87120270,"number":2187,"title":"Metadata Date","user":{"login":"pjdufour","id":1438253,"avatar_url":"https://avatars.githubusercontent.com/u/1438253?v=3","gravatar_id":"","url":"https://api.github.com/users/pjdufour","html_url":"https://github.com/pjdufour","followers_url":"https://api.github.com/users/pjdufour/followers","following_url":"https://api.github.com/users/pjdufour/following{/other_user}","gists_url":"https://api.github.com/users/pjdufour/gists{/gist_id}","starred_url":"https://api.github.com/users/pjdufour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjdufour/subscriptions","organizations_url":"https://api.github.com/users/pjdufour/orgs","repos_url":"https://api.github.com/users/pjdufour/repos","events_url":"https://api.github.com/users/pjdufour/events{/privacy}","received_events_url":"https://api.github.com/users/pjdufour/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GeoNode/geonode/labels/bug","name":"bug","color":"ec6427"},{"url":"https://api.github.com/repos/GeoNode/geonode/labels/ckan-integration","name":"ckan-integration","color":"ededed"},{"url":"https://api.github.com/repos/GeoNode/geonode/labels/enhancement","name":"enhancement","color":"02d7e1"},{"url":"https://api.github.com/repos/GeoNode/geonode/labels/metadata","name":"metadata","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/GeoNode/geonode/milestones/7","html_url":"https://github.com/GeoNode/geonode/milestones/2.5.x","labels_url":"https://api.github.com/repos/GeoNode/geonode/milestones/7/labels","id":802450,"number":7,"title":"2.5.x","description":"","creator":{"login":"simod","id":779380,"avatar_url":"https://avatars.githubusercontent.com/u/779380?v=3","gravatar_id":"","url":"https://api.github.com/users/simod","html_url":"https://github.com/simod","followers_url":"https://api.github.com/users/simod/followers","following_url":"https://api.github.com/users/simod/following{/other_user}","gists_url":"https://api.github.com/users/simod/gists{/gist_id}","starred_url":"https://api.github.com/users/simod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simod/subscriptions","organizations_url":"https://api.github.com/users/simod/orgs","repos_url":"https://api.github.com/users/simod/repos","events_url":"https://api.github.com/users/simod/events{/privacy}","received_events_url":"https://api.github.com/users/simod/received_events","type":"User","site_admin":false},"open_issues":76,"closed_issues":4,"state":"open","created_at":"2014-09-25T11:58:37Z","updated_at":"2015-06-10T21:54:19Z","due_on":"2015-10-01T07:00:00Z","closed_at":null},"comments":1,"created_at":"2015-06-10T21:54:19Z","updated_at":"2015-06-11T12:03:03Z","closed_at":null,"body":"Right now, ResourceBase objects only use one date field to reference the \"metadata date\" and the \"data date\" in ISO metadata (https://github.com/GeoNode/geonode/blob/master/geonode/catalogue/templates/catalogue/full_metadata.xml#L81).  The metadata date (or gmd:dateStamp/gco:DateTime) should represent when the metadata was last changed.  The data date (https://github.com/GeoNode/geonode/blob/master/geonode/catalogue/templates/catalogue/full_metadata.xml#L118) should represent what time period the data in the dataset covers.\r\n\r\nThe metadata date is used by CKAN to decide whether to re-harvest a dataset.  If the metadata date and content hasn't changed then it doesn't reharvest.  See below for relevant code.\r\n\r\nWe should have an additional field (hidden from user) that tracks when the metadata was last changed otherwise CKAN won't reharvest datasets when only the metadata changes.  Since this will require a model change, we should hold for 2.5.x.  Related to #1125, Hotfix below to enable CKAN harvest.\r\n\r\nMetadata Date\r\nhttps://github.com/ckan/ckanext-spatial/blob/master/ckanext/spatial/model/harvested_metadata.py#L513\r\n\r\n\r\nData date\r\nhttps://github.com/ckan/ckanext-spatial/blob/master/ckanext/spatial/model/harvested_metadata.py#L544\r\n\r\n\r\n\r\n**Hotfix**\r\nChange logic to have gmd:DateStamp/gco:DateTime set to the current date, so user can \"flash\" ISO XML when they save.\r\n"},"comment":{"url":"https://api.github.com/repos/GeoNode/geonode/issues/comments/111107225","html_url":"https://github.com/GeoNode/geonode/issues/2187#issuecomment-111107225","issue_url":"https://api.github.com/repos/GeoNode/geonode/issues/2187","id":111107225,"user":{"login":"tomkralidis","id":910430,"avatar_url":"https://avatars.githubusercontent.com/u/910430?v=3","gravatar_id":"","url":"https://api.github.com/users/tomkralidis","html_url":"https://github.com/tomkralidis","followers_url":"https://api.github.com/users/tomkralidis/followers","following_url":"https://api.github.com/users/tomkralidis/following{/other_user}","gists_url":"https://api.github.com/users/tomkralidis/gists{/gist_id}","starred_url":"https://api.github.com/users/tomkralidis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomkralidis/subscriptions","organizations_url":"https://api.github.com/users/tomkralidis/orgs","repos_url":"https://api.github.com/users/tomkralidis/repos","events_url":"https://api.github.com/users/tomkralidis/events{/privacy}","received_events_url":"https://api.github.com/users/tomkralidis/received_events","type":"User","site_admin":false},"created_at":"2015-06-11T12:03:03Z","updated_at":"2015-06-11T12:03:03Z","body":"To clarify, ISO has 3 notions of 'date' that we apply in GeoNode:\r\n\r\nItem | Element | Description | GeoNode binding\r\n------ | -----| -------------- | ----------------------\r\n1 | `//gmd:dateStamp` | date that the metadata was created | [`layer.date`](https://github.com/GeoNode/geonode/blob/master/geonode/catalogue/templates/catalogue/full_metadata.xml#L81)\r\n2 | `/gmd:identificationInfo//gmd:date`| reference date for the cited resource | [`layer.date`](https://github.com/GeoNode/geonode/blob/master/geonode/catalogue/templates/catalogue/full_metadata.xml#L118) && [`layer.date_type`](https://github.com/GeoNode/geonode/blob/master/geonode/catalogue/templates/catalogue/full_metadata.xml#L121)\r\n3 | `//gmd:temporalElement`| time period of the data | [`layer.temporal_extent_start`, `layer.temporal_extent_end`](https://github.com/GeoNode/geonode/blob/master/geonode/catalogue/templates/catalogue/full_metadata.xml#L272-L287)\r\n\r\nSo imagine item 2 being a date related to citation.  Item 2 is where we need the saved date checkpoint to be available.\r\n\r\nSounds like we need a `datestamp` attribute in `ResourceBase` to cover off Item 1 and updated workflow.\r\n\r\nWorkflow proposal:\r\n\r\n- first save\r\n - Item 1 set `datestamp` (happens once and only once in the lifetime of the metadata)\r\n - Item 2 set `date` set.  If 'public', then `date_type='publication'`, else `date_type='creation'`\r\n- on layer publication\r\n - Item 2 set `date` and `date_type='publication'`\r\n-  subsequent saves\r\n - Item 2 set `date` and `date_type='revision'`\r\n\r\nThis applies to the generated XML use case.  For layers that have their own XML uploaded by the user, continue the existing approach the XML is untouched / as is and the Item values are derived from the uploaded XML.\r\n\r\nThoughts?"}}