Uploaded image for project: 'Alfresco One Platform'
  1. Alfresco One Platform
  2. ACE-4030

Download as Zip action upon custom folder type

    Details

      Description

      In out project we have a custom folder type, which is a child of cm:folder:

      <type name="ef:folder">
        <title>Parent of all folders</title>
        <parent>cm:folder</parent>
        <mandatory-aspects>
          <aspect>ef:typed</aspect>
        </mandatory-aspects>
      </type>
      

      The problem is that when I press Download as Zip button for selected folder(s) I get empty zip file. It comes from startNode method of ZipDownloadExporter.java:

      @Override
      public void startNode(NodeRef nodeRef)
      {
        this.currentName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
        path.push(new Pair<String, NodeRef>(currentName, nodeRef));
        if (ContentModel.TYPE_FOLDER.equals(nodeService.getType(nodeRef)))
        {
          String path = getPath() + PATH_SEPARATOR;
          ZipArchiveEntry archiveEntry = new ZipArchiveEntry(path);
          try
          {
            zipStream.putArchiveEntry(archiveEntry);
            zipStream.closeArchiveEntry();
          }
          catch (IOException e)
          {
            throw new ExporterException("Unexpected IOException adding folder entry", e);
          }
        }
      }
      

      Since custom folder has type ef:folder this check returns false:

      if (ContentModel.TYPE_FOLDER.equals(nodeService.getType(nodeRef)))
      

      and folder is not added to the zip.

        Attachments

          Structure

            Activity

              People

              • Assignee:
                investigation Investigation Queue (Inactive)
                Reporter:
                streetturtle Pavel (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Structure Helper Panel