Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-1988

WorkflowPersistenceManager impl fails to create folders automatically when there's a document node as a folder path

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 2.22.10, 2.24.02, 2.25.01-alpha
    • None
    • None

    Description

      Suppose there's a hippo document in /content/documents/demosite/my/new/path/newdoc, which is a hippo:document handle.
      Now, you are creating a new document via WorkflowPersistenceManager in the path, /content/documents/demosite/my/new/path/newdoc/subdoc, where 'newdoc' should be a hippo folder and subdoc should be a hippo:document handle. However, this fails due to the following codes:

      public String createAndReturn(final String absPath, final String nodeTypeName, final String name, final boolean autoCreateFolders) throws ObjectBeanPersistenceException {
      try {
      final Node parentFolderNode;
      if (!session.itemExists(absPath)) {
      if (!autoCreateFolders)

      { throw new ObjectBeanPersistenceException("The folder node is not found on the path: " + absPath); }

      else

      { parentFolderNode = createMissingFolders(absPath); }

      } else

      { parentFolderNode = session.getNode(absPath); }

      return createNodeByWorkflow(parentFolderNode, nodeTypeName, name);
      } catch (ObjectBeanPersistenceException e)

      { throw e; }

      catch (Exception e)

      { throw new ObjectBeanPersistenceException(e); }

      }

      So, it tries to create a folder node only when there's no jcr item found by the path.
      It should have checked the node type of the folder path(s) as well..

      Attachments

        Activity

          People

            jsheriff Junaidh Kadhar Sheriff
            wko Woonsan Ko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: