{"id":302,"date":"2010-01-05T13:00:20","date_gmt":"2010-01-05T13:00:20","guid":{"rendered":"https:\/\/copyright.lboro.ac.uk\/lorls\/?p=302"},"modified":"2010-01-05T13:00:20","modified_gmt":"2010-01-05T13:00:20","slug":"clump-now-edits","status":"publish","type":"post","link":"https:\/\/blog.lboro.ac.uk\/lorls\/lorls\/clump-now-edits","title":{"rendered":"CLUMP Now Edits!"},"content":{"rendered":"<p>CLUMP has had the ability to display items ready for editing for a while now,\u00a0but users haven&#8217;t actually been able to save the items once they have finished making changes. \u00a0I have finally gotten round to writing the code to do this.<\/p>\n<p>The main difficulty I had was, do I get CLUMP to simply write every bit of metadata back to LUMP or do I try to do something a bit more robust. \u00a0After discussing this with the rest of the team we decided that when CLUMP pulls the metadata out for displaying in the edit form it needs to store the current timestamp for each piece of metadata. \u00a0Then when it comes to saving the data CLUMP first needs to get another copy from LUMP and compare the metadata on the server to the metadata being written back.<\/p>\n<p>If CLUMP&#8217;s and LUMP&#8217;s metadata values match then there is no need to write that value back to the server (thus preserving its timestamp). \u00a0If the value of a piece of metadata for CLUMP differs to LUMP then CLUMP needs to compare the relevant timestamps.<\/p>\n<p>If the timestamp for the metadata from LUMP matches the one CLUMP has stored then it knows it can write the value back to LUMP as it is a change the user has made. \u00a0If the timestamps don&#8217;t match then the metadata is in a no man&#8217;s land state (as someone else has edited it at the same time) and CLUMP has to tell the user that the value on the server has changed and find out if they want the version that now exists on the server or the version that is on their edit form.<\/p>\n<p style=\"text-align: center\"><a href=\"https:\/\/blog.lboro.ac.uk\/lorls2\/wp-content\/uploads\/sites\/3\/2010\/01\/EditCLUMP_r741.png\" rel=\"lightbox[302]\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-304\" style=\"border: 2px solid black\" title=\"EditCLUMP_r74\" src=\"https:\/\/blog.lboro.ac.uk\/lorls2\/wp-content\/uploads\/sites\/3\/2010\/01\/EditCLUMP_r741.png\" alt=\"\" width=\"400\" height=\"250\" srcset=\"https:\/\/blog.lboro.ac.uk\/lorls\/wp-content\/uploads\/sites\/3\/2010\/01\/EditCLUMP_r741.png 1202w, https:\/\/blog.lboro.ac.uk\/lorls\/wp-content\/uploads\/sites\/3\/2010\/01\/EditCLUMP_r741-300x188.png 300w, https:\/\/blog.lboro.ac.uk\/lorls\/wp-content\/uploads\/sites\/3\/2010\/01\/EditCLUMP_r741-1024x642.png 1024w, https:\/\/blog.lboro.ac.uk\/lorls\/wp-content\/uploads\/sites\/3\/2010\/01\/EditCLUMP_r741-900x564.png 900w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>CLUMP has had the ability to display items ready for editing for a while now,\u00a0but users haven&#8217;t actually been able to save the items once they have finished making changes. \u00a0I have finally gotten round to writing the code to do this. The main difficulty I had was, do I get CLUMP to simply write [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[9,3],"tags":[29,87],"class_list":["post-302","post","type-post","status-publish","format-standard","hentry","category-clump","category-lorls","tag-editing","tag-timestamp","count-0","even alt","author-lbjlclboro-ac-uk","last"],"_links":{"self":[{"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/posts\/302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/comments?post=302"}],"version-history":[{"count":0,"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/posts\/302\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/media?parent=302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/categories?post=302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/tags?post=302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}