<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CMIS delete doesn't delete from version and archive stores in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/cmis-delete-doesn-t-delete-from-version-and-archive-stores/m-p/486449#M39816</link>
    <description>&lt;P&gt;If I add the aspect&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;'P:sys:temporary'&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and update its properties, before deleting the document, then once deleted, the document (node) is gone from the active and version2 stores, and also it does not get put into the archive store. Glad the alfresco repository that I am working with supports this aspect. Saved lots of time. Code snippet is like shown below.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;public void makeTheDocumentTemporary(CmisObject docObject) {
    Property&amp;lt;Object&amp;gt; secondaryTypes = docObject.getProperty("cmis:secondaryObjectTypeIds");
    List&amp;lt;Object&amp;gt; aspects = (secondaryTypes != null) ? secondaryTypes.getValues() : null;
    
    if (aspects == null) {
        aspects = new ArrayList&amp;lt;Object&amp;gt;();
    } else {
        aspects = new ArrayList&amp;lt;Object&amp;gt;(aspects); // Defensive copy
    }
    if (!aspects.contains("P:sys:temporary")) {
       aspects.add("P:sys:temporary");
    }
    HashMap&amp;lt;String, Object&amp;gt; props = new HashMap&amp;lt;String, Object&amp;gt;();
    props.put("cmis:secondaryObjectTypeIds", aspects);

    try {
      docObject.updateProperties(props);
    } catch (Exception e) {
       System.err.println("Error updating aspect properties: " + e.getMessage());
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jan 2025 17:16:29 GMT</pubDate>
    <dc:creator>edisonpaulgdev</dc:creator>
    <dc:date>2025-01-23T17:16:29Z</dc:date>
    <item>
      <title>CMIS delete doesn't delete from version and archive stores</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cmis-delete-doesn-t-delete-from-version-and-archive-stores/m-p/486406#M39805</link>
      <description>&lt;P&gt;We have Alfresco community edition 5.2.0. I do not think this version supports Rest API endpoints.&amp;nbsp;&lt;BR /&gt;My objective is to purge documents by a specific metadata property. I am trying to accomplish this using CMIS. This objectIdString is the UUID of the active store object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CmisObject cmisObject = cmisSession.getObject(objectIdString);
//With this I tried:
Document document = (Document) cmisObject;
document.deleteAllVersions();
//Also tried 
cmisObject.delete(true);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With either of these, only the active store object is deleted. Version and archive stores have the objects.&lt;BR /&gt;This is before deletion:&lt;BR /&gt;id | version | store_id | type_qname_id | mlo_cat | mlo_link | name6 | version | versiondesc | versionlabel | versionhistory | archivedby | archiveddate | rootversion | desc27&lt;BR /&gt;-----+---------+----------+---------------+---------+----------+------------+---------+-----------------+--------------+----------------+------------+--------------+-------------+--------&lt;BR /&gt;901 | 1 | 4 | 233 | License | 1695 | nature.jpg | | Initial Version | 1.0 | | | | |&lt;BR /&gt;899 | 5 | 6 | 233 | License | 1695 | nature.jpg | | | | | | | |&lt;BR /&gt;&lt;BR /&gt;After deletion:&lt;BR /&gt;id | version | store_id | type_qname_id | mlo_cat | mlo_link | name6 | version | versiondesc | versionlabel | versionhistory | archivedby | archiveddate | rootversion | desc27&lt;BR /&gt;------+---------+----------+---------------+---------+----------+------------+---------+-----------------+--------------+----------------+------------+--------------------------+-------------+--------&lt;BR /&gt;901 | 1 | 4 | 233 | License | 1695 | nature.jpg | | Initial Version | 1.0 | | | | |&lt;BR /&gt;1299 | 5 | 5 | 233 | License | 1695 | nature.jpg | | | | | admin | 2025-01-23T02:44:48.363Z | |&lt;BR /&gt;&lt;BR /&gt;I tried setting this in alfresco.global.properties and restarted&lt;BR /&gt;system.content.eagerOrphanCleanup=true&lt;BR /&gt;&lt;BR /&gt;Still does not help.&lt;BR /&gt;&lt;BR /&gt;Customer would like purge these documents. Even though they cannot access the deleted document, through another application, since they do not find the storage still staying the same size, they are skeptical about the deletion process.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any recommendation is appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 03:12:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cmis-delete-doesn-t-delete-from-version-and-archive-stores/m-p/486406#M39805</guid>
      <dc:creator>edisonpaulgdev</dc:creator>
      <dc:date>2025-01-23T03:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: CMIS delete doesn't delete from version and archive stores</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cmis-delete-doesn-t-delete-from-version-and-archive-stores/m-p/486449#M39816</link>
      <description>&lt;P&gt;If I add the aspect&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;'P:sys:temporary'&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and update its properties, before deleting the document, then once deleted, the document (node) is gone from the active and version2 stores, and also it does not get put into the archive store. Glad the alfresco repository that I am working with supports this aspect. Saved lots of time. Code snippet is like shown below.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;public void makeTheDocumentTemporary(CmisObject docObject) {
    Property&amp;lt;Object&amp;gt; secondaryTypes = docObject.getProperty("cmis:secondaryObjectTypeIds");
    List&amp;lt;Object&amp;gt; aspects = (secondaryTypes != null) ? secondaryTypes.getValues() : null;
    
    if (aspects == null) {
        aspects = new ArrayList&amp;lt;Object&amp;gt;();
    } else {
        aspects = new ArrayList&amp;lt;Object&amp;gt;(aspects); // Defensive copy
    }
    if (!aspects.contains("P:sys:temporary")) {
       aspects.add("P:sys:temporary");
    }
    HashMap&amp;lt;String, Object&amp;gt; props = new HashMap&amp;lt;String, Object&amp;gt;();
    props.put("cmis:secondaryObjectTypeIds", aspects);

    try {
      docObject.updateProperties(props);
    } catch (Exception e) {
       System.err.println("Error updating aspect properties: " + e.getMessage());
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 17:16:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cmis-delete-doesn-t-delete-from-version-and-archive-stores/m-p/486449#M39816</guid>
      <dc:creator>edisonpaulgdev</dc:creator>
      <dc:date>2025-01-23T17:16:29Z</dc:date>
    </item>
  </channel>
</rss>

