<?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: Folder is not a folder??? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/folder-is-not-a-folder/m-p/264523#M217653</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, maybe someone can explain the "best practices" for this, because I think I found my problem, and it has to do with an inconsistency, but may or may-not be an Alfresco bug…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my code, I create a folder (any folder, I do them all with the same method) :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Folder fldrObj = destFolder.createFolder(props);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This returns a new Folder (yes, of course…bear with me &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt; ).&amp;nbsp; Getting the objectId of this new folder via fldrObj.getId() gives me this long string, ending with a UUID.&amp;nbsp; Fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Next, if I have to update the properties of the "new" folder, I change-up my property-map and use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ObjectId retID = fldrObj.updateProperties(props, true);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This ObjectId, when I do a .getId() on it has the identical string as before, except a ";1.0" appended.&amp;nbsp; Interesting, I say.&amp;nbsp; I guess Alfresco auto-versioned the folder or something when I updated the properties.&amp;nbsp; Fine.&amp;nbsp; The updated ID works fine if I go re-fetch the folder object:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fldrObj = session.getObject(retID);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BUT, if I use that ID with the suffix in a getObject() and then use that folder like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Folder nextFldr = fldrObj.createFolder(props);&lt;/SPAN&gt;&lt;BR /&gt;&lt;EM&gt;That &lt;/EM&gt;&lt;SPAN&gt;is when it fails with the "Folder is not a folder!" exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, if I take off that suffix – if I keep the original objectId from the first time I saved the folder – the next folder can be created and linked as a child just fine.&amp;nbsp; Furthermore, if I perform a getObjectByPath() on the path of the first folder, it too does not return the suffix.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the bottom-line is that there seems to be an inconsistency in the ObjectId's returned from a CmisObject versus what gets returned in a CmisObject.updateProperties() method…and Alfresco (or CMIS) does not like it if you use the "extended version".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With all that said, maybe someone knows the root-reason for all this, and which .getId() methods we should trust to always work, and which ones to stay away from?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for hearing me out…&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-AJ&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jul 2012 01:32:44 GMT</pubDate>
    <dc:creator>aweber1nj</dc:creator>
    <dc:date>2012-07-11T01:32:44Z</dc:date>
    <item>
      <title>Folder is not a folder???</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/folder-is-not-a-folder/m-p/264519#M217649</link>
      <description>I'm getting the following exception (snippet) when I'm trying to create a new folder and add it to an existing folder.&amp;nbsp; This existing folder, the "prospective parent" is a custom folder type.I was able to use the same code to add a folder to a cmis:folder parent, so I'm wondering if there's somethin</description>
      <pubDate>Tue, 10 Jul 2012 17:15:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/folder-is-not-a-folder/m-p/264519#M217649</guid>
      <dc:creator>aweber1nj</dc:creator>
      <dc:date>2012-07-10T17:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Folder is not a folder???</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/folder-is-not-a-folder/m-p/264520#M217650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if "curTypeName" is "Folder", than this won't work as "Folder" is not a valid type(name). As far as I see it, this probably has nothing to do with the type of the target folder, just with the proposed type of the child folder.&amp;nbsp; "curTypeName" should be the qualified name (namespace/prefix + localName) of a content type in Alfresco (see Alfresco Data Dictionary guide in the wiki) which extends from "cm:folder" built-in type that maps to "cmis:folder".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Axel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2012 21:55:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/folder-is-not-a-folder/m-p/264520#M217650</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2012-07-10T21:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Folder is not a folder???</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/folder-is-not-a-folder/m-p/264521#M217651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The folder type I am trying to create is efr:legal_folder. As you can see, it gets prefixed with F: as well. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have already created one using this code successfully (in many tests),&amp;nbsp; the error occurs when I create one and try to link it to the first one (to make a child of the first one I created). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The first one creates perfectly, and I verify that with Share, Explorer, and cmis workbench.&amp;nbsp; And stepping through the debugger, the original is absolutely instantiated as alfrescofolderimpl (and the properties are correct). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's why I think it is the CMIS service checking the parent during create, and not correctly identify it as a folder subtype.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2012 22:41:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/folder-is-not-a-folder/m-p/264521#M217651</guid>
      <dc:creator>aweber1nj</dc:creator>
      <dc:date>2012-07-10T22:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Folder is not a folder???</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/folder-is-not-a-folder/m-p/264522#M217652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I verified this further with another test.&amp;nbsp; I changed the type of the "parent folder" to be a regular folder (cmis:folder).&amp;nbsp; I created it (with Apache Chemistry/Alfresco OpenCMIS Extension), then tried linking 4 subfolders to that parent. &lt;/SPAN&gt;&lt;EM&gt;All 4 subfolders are of a custom folder type.&amp;nbsp; All 4 created and linked perfectly.&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, in this test, I did not change the folder name of the parent (rename it) between creating it and trying to create and link the "children".&amp;nbsp; Again, this worked.&amp;nbsp; I try to re-fetch the parent before linking the newly created children, using getObject and a OperationContext with setCacheEnabled = FALSE – always.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I think something might be getting screwed-up in the cache, because if I let the code rename the parent, then re-fetch it (using getObject with cache disabled), then use that in my destFldr.createFolder( ), it fails with the aforementioned exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So my hypothesis changed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Going to continue testing and "playing with" OperationContexts to see if I can sort it out.&amp;nbsp; The mystery remains!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Happy to provide further details if needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-AJ&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2012 23:50:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/folder-is-not-a-folder/m-p/264522#M217652</guid>
      <dc:creator>aweber1nj</dc:creator>
      <dc:date>2012-07-10T23:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Folder is not a folder???</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/folder-is-not-a-folder/m-p/264523#M217653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, maybe someone can explain the "best practices" for this, because I think I found my problem, and it has to do with an inconsistency, but may or may-not be an Alfresco bug…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my code, I create a folder (any folder, I do them all with the same method) :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Folder fldrObj = destFolder.createFolder(props);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This returns a new Folder (yes, of course…bear with me &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt; ).&amp;nbsp; Getting the objectId of this new folder via fldrObj.getId() gives me this long string, ending with a UUID.&amp;nbsp; Fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Next, if I have to update the properties of the "new" folder, I change-up my property-map and use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ObjectId retID = fldrObj.updateProperties(props, true);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This ObjectId, when I do a .getId() on it has the identical string as before, except a ";1.0" appended.&amp;nbsp; Interesting, I say.&amp;nbsp; I guess Alfresco auto-versioned the folder or something when I updated the properties.&amp;nbsp; Fine.&amp;nbsp; The updated ID works fine if I go re-fetch the folder object:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fldrObj = session.getObject(retID);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BUT, if I use that ID with the suffix in a getObject() and then use that folder like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Folder nextFldr = fldrObj.createFolder(props);&lt;/SPAN&gt;&lt;BR /&gt;&lt;EM&gt;That &lt;/EM&gt;&lt;SPAN&gt;is when it fails with the "Folder is not a folder!" exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, if I take off that suffix – if I keep the original objectId from the first time I saved the folder – the next folder can be created and linked as a child just fine.&amp;nbsp; Furthermore, if I perform a getObjectByPath() on the path of the first folder, it too does not return the suffix.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the bottom-line is that there seems to be an inconsistency in the ObjectId's returned from a CmisObject versus what gets returned in a CmisObject.updateProperties() method…and Alfresco (or CMIS) does not like it if you use the "extended version".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With all that said, maybe someone knows the root-reason for all this, and which .getId() methods we should trust to always work, and which ones to stay away from?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for hearing me out…&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-AJ&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2012 01:32:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/folder-is-not-a-folder/m-p/264523#M217653</guid>
      <dc:creator>aweber1nj</dc:creator>
      <dc:date>2012-07-11T01:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Folder is not a folder???</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/folder-is-not-a-folder/m-p/264524#M217654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am facing exactly the same problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A cmis:folder after creation is fetching a guid say 'xxx'. After updating the same folder, the guid returned is 'xxx;1.0'. On the other hand, documents are returning the same guid before and after update.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think this is an alfresco issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can somebody help us out on what is going wrong in here.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 12:09:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/folder-is-not-a-folder/m-p/264524#M217654</guid>
      <dc:creator>pankajt</dc:creator>
      <dc:date>2012-08-07T12:09:11Z</dc:date>
    </item>
  </channel>
</rss>

